home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #2 / Amiga Plus CD - 1995 - No. 2.iso / internet / faq / englisch / motif < prev    next >
Encoding:
Text File  |  1995-04-11  |  369.2 KB  |  9,435 lines

  1. Archive-name: motif-faq/part1
  2. Last-modified: FEB 11, 1995
  3. Posting-Frequency: monthly
  4. Organization: Century Computing, Inc.
  5. Version: 4.1
  6.  
  7.  
  8. Motif FAQ
  9.  
  10. [Last changed: 11 FEB 95]
  11.  
  12. This article contains the answers to some Frequently Asked Questions (FAQ) 
  13. often seen in comp.windows.x.motif. It is posted to help reduce volume in 
  14. this newsgroup and to provide hard-to-find information of general interest.
  15.  
  16.         Please redistribute this article!
  17.  
  18. This FAQ is maintained by Ken Sall (ksall@cen.com) of Century Computing, Inc.  
  19. Send updates and corrections to me at that email address.  It would help if
  20. the subject line contained the phrase "For Motif FAQ".  I will be making a
  21. HTML version available sometime in the future. In the meantime, World Wide 
  22. Web'sters are directed to the automatically generated HTML version of this
  23. FAQ at the URL:
  24.  
  25.       http://www.cis.ohio-state.edu/hypertext/faq/usenet/motif-faq/top.html
  26.  
  27. There is also a WAIS database of FAQs which you can search :
  28.  
  29.       http://www.cs.ruu.nl/cgi-bin/faqwais
  30.  
  31. This is particularly useful since it's possible the answer you're looking for 
  32. is in another FAQ (X, Xt, Widgets FAQ, etc.)
  33.  
  34. *** PLEASE NOTE ***
  35. If you don't understand the above "http://" notation, see the subject:
  36. "What is an URL?" 
  37.  
  38. In some cases, I've repeated information in different contexts to make
  39. these details a bit easier to find.
  40.  
  41. This article includes answers to the questions listed below. Key:
  42.  
  43.                 + questions NEW to this issue;
  44.                 * CHANGES since last issue.
  45.       
  46.  
  47.  0)  TOPIC: SUBMITTING SUGGESTIONS, CORRECTIONS, NEW ANSWERS
  48.  1)+ TOPIC: WHAT IS MOTIF?
  49.  2)+ What is Motif and how does it relate to the X Toolkit and X  Window  Sys-
  50. tem?
  51.  3)* TOPIC: OTHER RELEVANT NEWSGROUPS
  52.  4)  TOPIC: FAQ and NEWSGROUP FTP ARCHIVES
  53.  5)  Is the FAQ available via FTP?
  54.  6)  Is this FAQ accessible via WWW?
  55.  7)  What is an URL? Are "ftp://", "http://", and "gopher://" typos?
  56.  8)* Where can I find other FAQs related to Motif or X11?
  57.  9)  Is this newsgroup accessible via email?
  58. 10)  Is this newsgroup archived?
  59. 11)  Is the mail list motif-talk archived?
  60. 12)  TOPIC: OSF, MOTIF and COSE
  61. 13)  What versions of Motif are there?
  62. 14)  Is there a concise features list for Motif 2.0?
  63. 15)  What are the details about new features in Motif 2.0?
  64. 16)+ Where can I find Motif 2.0 documentation?
  65. 17)* Where can I get Motif?
  66. 18)  Is there a list of Motif bugs?
  67. 19)  What is COSE and how does it relate to Motif?
  68. 20)+ Is there a CDE FAQ or newsgroup?
  69. 21)  What is PST?
  70. 22)  Does OSF's PST process impact CDE evolution?
  71. 23)  Because of COSE, is Motif now in the public domain?
  72. 24)  What is DCE?
  73. 25)  Where can I get public domain Motif source?
  74. 26)  Are Motif code examples publically available?
  75. 27)  Has anyone done a public domain Motif lookalike?
  76. 28)  Does anyone from OSF pay attention to our questions/suggestions?
  77. 29)  Does OSF have an application compliance validation service?
  78. 30)  What is the motif-talk mailing list?
  79. 31)  What MIT patches do I use, and when do I use fix-osf?
  80. 32)  How does Motif work with X11R5?
  81. 33)  How can I find which version of Motif I have?
  82. 34)  TOPIC: MOTIF and the WORLD WIDE WEB (WWW)
  83. 35)* Where's an HTML version of the Motif FAQ on World Wide Web (WWW)?
  84. 36)* What are other interesting WWW URLs which are related to Motif?
  85. 37)  Where can I get the HTML widget used in Mosaic?
  86. 38)  TOPIC: BOOKS and JOURNALS
  87. 39)  Is there a bibliography available?
  88. 40)  Is there a Motif tutorial?
  89. 41)* What books are available for Motif programmers?
  90. 42)* Which Xt and X books would also be helpful?
  91. 43)+ Are there books for X11R6 yet?
  92. 44)* What relevant journals are available?
  93. 45)  TOPIC: MWM
  94. 46)  What is the difference between Motif and mwm?
  95. 47)  Does anyone have an alternative set of  3-D  defaults  for  a  monochrome
  96. screen?
  97. 48)  How can I modify the Motif window manager decorations?
  98. 49)  Is there an ICCCM compliant way of setting window manager decorations?
  99. 50)  How can I turn off the Motif window manager  functions  from  the  system
  100. menu?
  101. 51)+ How can my application know when the user has quit Mwm?
  102. 52)* How can I tell if the user has selected the "Close"
  103. 53)  Is there an mwm virtual desktop manager?
  104. 54)  Why does mwm 1.2 crash on startup?
  105. 55)  TOPIC: MOTIF DEVELOPMENT TOOLS (GUI BUILDERS and UIMS's)
  106. 56)  What tools exist to assist in developing Motif applications?
  107. 57)  TOPIC: GEOMETRY MANAGEMENT
  108. 58)  Why is geometry management so important?
  109. 59)  What are good references for reading about geometry management?
  110. 60)  Why don't my labels resize in a RowColumn widget?
  111. 61)  Why do dialogs appear smaller under 1.2.3 and later?
  112. 62)  TOPIC: TEXT WIDGET
  113. 63)  How do XmTextField and a single line XmText widget differ?
  114. 64)  Why does  pressing  <return> in a text widget do nothing?
  115. 65)  When I add text to a scrolling text widget, how can I get the new text to
  116. show?
  117. 66)  Does the text widget support 16 bit character fonts?
  118. 67)  How can I stop the text widget from echoing characters typed?
  119. 68)  How can I replace characters typed with say a `*'?
  120. 69)  How can I best add a large piece of text to a scrolled text widget?
  121. 70)  How can I highlight text in the Text widget?
  122. 71)  How can I select all of the text in a widget programmatically?
  123. 72)  How can I change colours of text in the Text widget?
  124. 73)  How can I change the font of text in the Text widget?
  125. 74)  Is there an emacs binding for the text widget?
  126. 75)  What if I have problems with the backspace/delete keys?
  127. 76)  How can I use a file as the text source for a Text widget?
  128. 77)* How can put Text in overstrike mode instead of insert?
  129. 78)  How can I make the Delete key do a Backspace?
  130. 79)  TOPIC: LIST WIDGET
  131. 80)  Should I create an XmList widget as a child of automatic XmScrolledWindow
  132. or use the XmCreateScrolledList() convenience function?
  133. 81)  How do I best put a new set of items into a list?
  134. 82)  Can I have strings with different fonts in a list?
  135. 83)  Can I get a bitmap to show in a list item like I can in a Label?
  136. 84)  Can I have items with different colours in a list?
  137. 85)  Can I grey out an item in a list?
  138. 86)  Can I have multi-line items in a list?
  139. 87)  How can I tell the position of selected items in a list?
  140. 88)  TOPIC: FILE SELECTION BOX WIDGET
  141. 89)  What is libPW.a and do I need it?
  142. 90)  What are these compile errors: Undefined symbol _regcmp and _regex?
  143. 91)  What's wrong with the Motif 1.0 File Selection Box?
  144. 92)  TOPIC: FORM WIDGET
  145. 93)  Why don't labels in a Form resize when the label is changed?
  146. 94)  How can I center a widget in a form?
  147. 95)  How do I line up two columns of widgets of different types?
  148. 96)  TOPIC: PUSHBUTTON WIDGET
  149. 97)  Why can't I use accelerators on buttons not in a menu?
  150. 98)  TOPIC: ICON WIDGET
  151. 99)  How can I add multi-colored icons to my application?
  152. 100)  How can I convert a Sun/GIF/TIFF image to a pixmap?
  153. 101)+ TOPIC: SCALE WIDGET
  154. 102)+ Can the XmScale widget have arrows or tick marks in Motif 2.0?
  155. 103)  TOPIC: LABEL WIDGET
  156. 104)  How can I align the text in a label (button, etc) widget?
  157. 105)  Why doesn't label alignment work in a RowColumn?
  158. 106)* How can I set a multiline label?
  159. 107)  How can I have a vertical label?
  160. 108)  How can I have a Pixmap in a Label?
  161. 109)  TOPIC: DRAWING AREA WIDGET
  162. 110)  How can I send an expose event to a Drawing Area widget?
  163. 111)  How can I know when a DrawingArea has been resized?
  164. 112)  TOPIC: MENUS
  165. 113)  How do I set the current choice in a radio box or an option menu?
  166. 114)  How do I make a menu choice insensitive if it  was  created  with  XmVa-
  167. CreateSimplePulldownMenu?
  168. 115)  What can I put inside a menu bar?
  169. 116)  Can I have a cascade button without a submenu in a pulldown menu?
  170. 117)  Should I have a cascade button without a submenu in a pulldown menu?
  171. 118)  What is the best way to create popup menus?
  172. 119)  How do popup menus work?
  173. 120)  Should I use translation tables or actions for popup menus?
  174. 121)  What are the known bugs in popup menus?
  175. 122)  Can I have multiple popup menus on the same widget?
  176. 123)  TOPIC: INPUT FOCUS
  177. 124)  How can I specify the widget that should have the keyboard focus when my
  178. application starts up?
  179. 125)  How can I direct the keyboard input to a particular widget?
  180. 126)* How can I have a modal dialog which has to be answered before the appli-
  181. cation can continue?
  182. 127)  TOPIC: MEMORY AND SPEED
  183. 128)  When can I free data structures passed to or retrieved from Motif?
  184. 129)* Why does my application grow in size?
  185. 130)  Why does my application take a long time to start up?
  186. 131)  My application is running too slowly. How can I speed it up?
  187. 132)  Why is my application so huge?
  188. 133)* TOPIC: XMSTRING
  189. 134)* What string functions differ in Motif 1.2 (compared to
  190. 135)  How can I get the Ascii text out of an XmString?
  191. 136)  When can XmStrings used as resources be freed?
  192. 137)  Why doesn't XmStringGetNextSegment() work properly?
  193. 138)  Why does using XmStringDraw cause a Bad Font error?
  194. 139)  TOPIC: DIALOGS
  195. 140)  How do I stop my dialog disappearing when I press the help button?
  196. 141)  How do I make my own dialog?
  197. 142)  Why do dialog title bars have "_popup" or  "<-popup"  concatenated  onto
  198. the widget name?
  199. 143)  How can I force a dialog window to display?
  200. 144)* How can I control placement of a popup widget?
  201. 145)  TOPIC: LANGUAGE BINDINGS
  202. 146)  Is there a C++ binding for Motif?
  203. 147)  How can I avoid C++ String class and typedef char *String conflicts
  204. 148)  How can I have a C++ member function in a callback?
  205. 149)  Is there a Common Lisp binding for Motif?
  206. 150)  Is there an Ada binding for Motif? (Part 1 of 2)
  207. 151)+ Is there an Ada binding for Motif? (Part 2 of 2)
  208. 152)  Is there a Poplog binding for Motif?
  209. 153)  TOPIC: SPECIFIC PLATFORMS
  210. 154)  Is it easy to build Motif for a Sun?
  211. 155)  How do I build Motif 1.2.2 on Solaris 2.1 with Sun C?
  212. 156)  What compile errors/warnings might I get in both Sun 3 and Sun 4?
  213. 157)  On a Sun 3, what are the mwm startup error messages about?
  214. 158)  Are there problems making shared libraries on a Sun?
  215. 159)  The OpenWindows server hangs when I popup a menu with Button 3.
  216. 160)  Has anyone made shared libraries on an IBM RS/6000?
  217. 161)  What is the error  "Unaligned access in XmString" under Ultrix?
  218. 162)  TOPIC: KEYSYMS
  219. 163)  What is causing the messages "unknown keysym osfDown..."?
  220. 164)  What happens if I can't install Motif Keysyms?
  221. 165)  Why has OSF introduced Keysyms into Motif 1.1?
  222. 166)+ Why do accented characters not work with Motif applications linked  with
  223. X11R6? What is the Compose file?
  224. 167)  TOPIC: UIL
  225. 168)  What is UIL and why is it so popular?
  226. 169)  What is Mrm?
  227. 170)  How do I specify a search path for ".uid" files?
  228. 171)  Can I specify callback functions in resource files?
  229. 172)  How can I set a multiline label in UIL?
  230. 173)  Is there a program that can convert a UIL file to tclMotif?
  231. 174)  TOPIC: ICONIFICATION and DE-ICONIFICATION
  232. 175)  How can I keep track of changes to iconic/normal window state?
  233. 176)  How can I check if my application has come up iconic?
  234. 177)  How can I start my application in iconic state?
  235. 178)  How can an application iconify itself?
  236. 179)  How can an application de-iconify itself?
  237. 180)* TOPIC: SPECIALIZED WIDGETS
  238. 181)  Where can I get a Table widget? Matrix widget? Spreadsheet widget?
  239. 182)  Where can I get a bar graph widget?
  240. 183)  Is there a graph widget in which you can add vertices and edges and  get
  241. automatic updating?
  242. 184)* Is there a help system available, such as in Windows 3?
  243. 185)  Is there a canvas widget or drawing widget for graphical display?
  244. 186)  TOPIC: CREATING WIDGETS
  245. 187)* What are some good references for creating  widgets  (subclassing  widg-
  246. ets)?
  247. 188)  TOPIC: MISCELLANEOUS
  248. 189)  How can an application be informed of signals?
  249. 190)  How do I control the repeat rate on a SUN keyboard ??
  250. 191)  How can I identify the children of a manager widget?
  251. 192)  How do I tell if a scrolled window's scrollbars are visible?
  252. 193)  How can I programatically scroll a XmScrolledWindow in XmAUTOMATIC mode?
  253. 194)  What functions can an application use to change the size or position  of
  254. a widget?
  255. 195)  What widgets give the look of push buttons, but behavior of toggle  but-
  256. tons?
  257. 196)  How do I obtain the size of a unmanaged shell widget?
  258. 197)  Can I use XtAddTimeOut, XtAddWorkProc, and  XtAddInput  with  XtAppMain-
  259. Loop?
  260. 198)  Why does XtGetValues  for  XmNx  and  XmNwidth  return  extremely  large
  261. values?
  262. 199)  XtGetValues() on XmNx and XmNy of my top level shell  don't  return  the
  263. correct root window coordinates.  How do I compute these?
  264. 200)  Can I use XmGetPixmap() with widgets that have non-default visual types?
  265. 201)  How can I determine the item selected in a option menu or a RadioBox?
  266. 202)  What is the matter with Frame in Motif 1.2?
  267. 203)  What is IMUG and how do I join it?
  268. 204)  How do I set the title of a top level window?
  269. 205)  Can I use editres with Motif?
  270. 206)  How can I put decorations on transient windows using olwm?
  271. 207)  Why does an augment translation appear to act as replace for some  widg-
  272. ets?
  273. 208)  How do you "grey" out a widget so that it cannot be activated?
  274. 209)  Why doesn't the Help callback work on some widgets?
  275. 210)  Can I specify a widget in a resource file?
  276. 211)  Why are only some of my translations are being installed?
  277. 212)  Where can I get the PanHandler code?
  278. 213)  What are these passive grab warnings?
  279. 214)* How do I have more buttons than three in a MessageBox?
  280. 215)* How do I create a "busy working cursor"?
  281. 216)  Can I use the hourglass that mwm uses?
  282. 217)  What order should the libraries be linked in?
  283. 218)  How do I use xmkmf for Motif clients?
  284. 219)  How do I make context sensitive help?
  285. 220)  How do I debug a modal interaction?
  286. 221)  How can I disable Drag and Drop in my Motif 1.2 client ?
  287. 222)  Where can I get info on the Motif drag and drop protocol?
  288. 223)  Why can't I install my own colormap using XInstallColormap?
  289. 224)  How do I get correct shadow colors to match other color changes?
  290. 225)  What color algorithm does Motif use?
  291. 226)  How can you access the superclass widget from  which  Motif  convenience
  292. dialogs are subclassed?
  293. 227)  Can the Notebook widget display non-rectangular "file tabs"?
  294. 228)  How does the clipboard mechanism work?
  295. 229)+ Why does the xyz application core dump when I cut and paste?
  296. 230)  TOPIC: HISTORY and ACKNOWLEDGEMENTS
  297.  
  298.  
  299. -----------------------------------------------------------------------------
  300. Subject:  0)  TOPIC: SUBMITTING SUGGESTIONS, CORRECTIONS, NEW ANSWERS
  301.  
  302. [Last modified: Oct 94]
  303.  
  304. Answer: If you have suggestions or corrections for any of these answers or any
  305. additional information, please send them directly to Ken Sall at
  306. ksall@cen.com.  The information will be included in the next revision or two.
  307.  
  308.         o Send updates, suggestions, corrections, new answers to:
  309.  
  310.                         ksall@cen.com   (Ken Sall)
  311.  
  312.           (In general, if you want your info in a particular month's FAQ,
  313.           send it at least a week before the end of the month.)
  314.  
  315.         o _Please_ put "For Motif FAQ" in the Subject line!
  316.  
  317.         o Submissions should be of general interest.
  318.  
  319.         o Please include answers with questions.
  320.  
  321.         o If you _do not_ want your name or email address listed in the FAQ,
  322.           explicitly state this.
  323.  
  324. NOTE TO BUSINESSES: Please send your announcements/updates/corrections in a
  325. brief, ready-to-include form. I'd rather not spend alot of time editing the
  326. information.
  327.  
  328.  
  329. This posting is intended to be distributed at approximately the beginning of
  330. each month.
  331.  
  332. The information contained herein has been gathered from a variety of sources.
  333. In many cases attribution has been lost; if you would like to claim
  334. responsibility for a particular item, please let us know.
  335.  
  336. Conventions used below: telephone numbers tend to be Bell-system unless
  337. otherwise noted; prices on items are not included.
  338.  
  339. -----------------------------------------------------------------------------
  340. Subject:  1)+ TOPIC: WHAT IS MOTIF?
  341.  
  342. -----------------------------------------------------------------------------
  343. Subject:  2)+ What is Motif and how does it relate to the X Toolkit and X
  344. Window System?
  345.  
  346.  
  347. [Last modified: Feb 95]
  348.  
  349. Answer:
  350.  
  351. Motif is a widely-accepted set of user interface guidelines developed by the
  352. Open Software Foundation (OSF) around 1989 which specifies how an X Window
  353. System application should "look and feel". OSF/Motif, as it's more formally
  354. called, includes the Motif Toolkit (also called "Xm" or the "Motif widgets"),
  355. which enforce a policy on top of the X Toolkit Intrinsics ("Xt"). Xt is really
  356. a "mechanism not policy" layer, and Xm provides the specific "look and feel".
  357. For example, Xt does not insist that windows have titlebars or menus, but it
  358. provides hooks for developers of specific toolkits (Motif, OpenLook, Athena
  359. widgets) to take advantage of. In addition to widgets, OSF/Motif includes the
  360. Motif Style Guide document (as well as several others listed in my FAQ) which
  361. details how a Motif user interface should look and behave to be "Motif
  362. compliant".
  363.  
  364. The X Toolkit Intrinsics are built upon the lowest programming level API
  365. called "Xlib" (X library). Both Xlib and Xt are specified by the X Consortium
  366. (formerly called the MIT X Consortium), which you can reach at:
  367.         http://www.x.org/ or:
  368.         ftp to ftp.x.org
  369.  
  370. Xlib and Xt source code is free. Motif is not.
  371.  
  372. -----------------------------------------------------------------------------
  373. Subject:  3)* TOPIC: OTHER RELEVANT NEWSGROUPS
  374.  
  375. [Last modified: Feb 95]
  376.  
  377. Answer: This newsgroup is comp.windows.x.motif.  The WWW URL is:
  378.  
  379.         news:comp.windows.x.motif
  380.  
  381.  
  382. The nearest related group is comp.windows.x.  It also maintains an FAQ, which
  383. deals in all sorts of X, Xlib and Xt questions. Look there for answers to
  384. questions such as "How do I get a screendump of my application?", "where do I
  385. get X11R4,X11R5, X11R6", etc.  The URLs for other groups which may have
  386. relevant information are:
  387.  
  388.         news:comp.windows.x.pex
  389.         news:comp.windows.x.apps
  390.         news:comp.windows.x.intrinsics
  391.         news:comp.windows.news
  392.         news:comp.windows.misc
  393.         news:comp.windows.open-look
  394.         news:alt.windows.cde
  395.  
  396.  
  397. The intrinsics and open-look groups also have an FAQ.
  398.  
  399. The newsgroup news.answers contains *lots* of FAQs (including this one).  Look
  400. there for lots of info on everything.
  401.  
  402. -----------------------------------------------------------------------------
  403. Subject:  4)  TOPIC: FAQ and NEWSGROUP FTP ARCHIVES
  404.  
  405. -----------------------------------------------------------------------------
  406. Subject:  5)  Is the FAQ available via FTP?
  407.  
  408. [Last modified: Oct 94]
  409.  
  410. Answer: A number of FAQ's (including this one) are available via anonymous ftp
  411. at rtfm.mit.edu under the directory pub/usenet.
  412.  
  413. The Motif FAQ is available in 6 parts via anonymous ftp in any of the
  414. following directories at rtfm.mit.edu:
  415.  
  416.         /pub/usenet-by-group/comp.windows.x.motif
  417.         /pub/usenet-by-group/comp.answers/motif-faq
  418.         /pub/usenet-by-group/news.answers/motif-faq
  419.  
  420.  
  421. There is also a mail server called mail-server@rtfm.mit.edu.  To retrieve a
  422. file send mail to the server with a subject or body similar to
  423.  
  424.         send usenet/comp.windows.x.motif/Motif_FAQ_(Part_1_of_6).Z
  425.  
  426.  
  427. The Motif FAQ is also available via anonymous ftp as a single file:
  428.  
  429.         /contrib/faqs/Motif-FAQ from ftp.x.org.
  430.  
  431.  
  432. (See also "Is this FAQ accessible via WWW?")
  433.  
  434. The FAQ is also accessible from WAIS (Wide Area Information System) under UC-
  435. Motif-FAQ, allowing keyword-based searches of the FAQ.
  436.  
  437. -----------------------------------------------------------------------------
  438. Subject:  6)  Is this FAQ accessible via WWW?
  439.  
  440. [Last modified: Oct 94]
  441.  
  442. Answer:
  443.  
  444. The Motif FAQ is available as a single file via the World Wide Web URL:
  445.  
  446.         ftp://ftp.x.org/contrib/faqs/Motif-FAQ
  447.  
  448. and also:
  449.  
  450.         ftp://ftp.germany.eu.net/pub/X11/XConsortium/contrib/faqs/Motif-FAQ
  451.  
  452. and as 6 separate parts as:
  453.  
  454.         ftp://rtfm.mit.edu/pub/usenet-by-group/comp.windows.x.motif/Motif_FAQ_(Part_n_of_6)
  455.         ftp://rtfm.mit.edu/pub/usenet-by-group/comp.answers/motif-faq/part[1-6]
  456.         ftp://rtfm.mit.edu/pub/usenet-by-group/news.answers/motif-faq/part[1-6]
  457.  
  458.  
  459. In addition, an automatically generated HTML version of this FAQ can be found
  460. at:
  461.  
  462.         http://www.cis.ohio-state.edu/hypertext/faq/usenet/motif-faq/top.html
  463.  
  464.  
  465. A more in-depth restructuring using HTML is planned for the future.
  466.  
  467. -----------------------------------------------------------------------------
  468. Subject:  7)  What is an URL? Are "ftp://", "http://", and "gopher://" typos?
  469.  
  470. [Last modified: Oct 94]
  471.  
  472. Answer: No, they are not typos.  All location references in this FAQ are
  473. slowly being replaced with WWW (World Wide Web) URLs (Uniform Resource
  474. Locator). Basically, an URL is a unique location of a Web resource (directory,
  475. file, image, host, etc.). If you want to read more about URL's, get the
  476. PostScript paper from ftp.ncsa.uiuc.edu:
  477.  
  478.         Mosaic/mosaic-papers/getting-started.ps
  479.  
  480. If you don't know how to access the Web, you can still access locations via
  481. anonymous ftp by dropping the "ftp://" protocol portion and interpreting the
  482. next section as the domain name. For example, for an URL of
  483.  
  484.         ftp://any.old.place/dirname/filename
  485.  
  486. connect via anonymous ftp to any.old.place and get /dirname/filename.
  487.  
  488. Similarly, if the location begins "gopher://", drop the protocol portion,
  489. telnet to the host and login as "gopher".
  490.  
  491. If the location in this FAQ begins with "http://" and you aren't a Web user,
  492. simply ignore the reference. Or, you could check out the WWW FAQ (2 or more
  493. parts) from rtfm.mit.edu directory:
  494.  
  495.          /pub/usenet/news.answers/www/faq
  496.  
  497. (URL: ftp://rtfm.mit.edu/pub/usenet/news.answers/www/faq )
  498.  
  499. Why are URLs being used? For those who regularly access the Web (via browsers
  500. such as Mosaic, WinWeb, Chimera, Lynx, W3, tkWWW, etc.), this notation greatly
  501. facilitates access to the cited documents/directories/files. And, for this FAQ
  502. maintainer, URLs make it easier to verify whether the pointer is still
  503. accurate! Instead of typing:
  504.  
  505.         ftp any.old.place
  506.         logging in as anonymous
  507.         entering my email address
  508.         cd /dirname
  509.         get filename
  510.  
  511. I can simply use the "Open URL" feature of my browser and paste
  512. "ftp://any.old.place/dirname/filename" in one step. 'Nuff said!
  513.  
  514. -----------------------------------------------------------------------------
  515. Subject:  8)* Where can I find other FAQs related to Motif or X11?
  516.  
  517. [Last modified: Feb 95]
  518.  
  519. Answer: Check out the directory /contrib/faqs on ftp.x.org. As of August,
  520. 1994, these FAQs were available:
  521.  
  522.  
  523.      FAQ                - X11 FAQ
  524.      FAQ-X11Games.doc.gz- high priority research projects ;-)
  525.      FAQ-Xt             - X Toolkit
  526.      Intel-Unix-X-faq.Z - Intel-specific information
  527.      Motif-FAQ          - this FAQ
  528.      Widget.FAQ.Z       - useful list of available widgets (John L. Cwikla)
  529.      speedup-x-faq      - how to maximize the performance of X
  530.  
  531.  
  532. Web'sters can check out the URL: ftp://ftp.x.org/contrib/faqs/
  533. Grab the X FAQ and the Widget FAQ:
  534.  
  535.         ftp://ftp.x.org/contrib/faqs/FAQ
  536.         ftp://ftp.x.org/contrib/faqs/Widget.FAQ.Z
  537.  
  538.  
  539. There is also a CDE FAQ at:
  540.  
  541.     http://proper.com:70/0/faqs-link/common-faqs/faqs/cde-cose-faq
  542.  
  543. -----------------------------------------------------------------------------
  544. Subject:  9)  Is this newsgroup accessible via email?
  545.  
  546. [Last modified: Nov 94]
  547.  
  548. Answer: The email link, formerly maintained by Brian Dealy (via motif-
  549. request@lobo.gsfc.nasa.gov), is no longer being attended.  You cannot be added
  550. to the list at this time.  The mailing list address is no longer valid.
  551.  
  552.  
  553.         NOTE: As of October 31, 1994, Brian was seeking a new maintainer for
  554.         the mail reflector for people without access to comp.windows.x.motif.
  555.         If interested, email him at his new address: bdealy@c3i.saic.com.
  556.  
  557.  
  558. -----------------------------------------------------------------------------
  559. Subject: 10)  Is this newsgroup archived?
  560.  
  561. [Last modified: November 1992]
  562.  
  563. Answer: The newsgroup files from August 1991 are available from
  564. csc.canberra.edu.au (137.92.1.1) by anonymous ftp.  They are in the directory
  565. /pub/motif/comp.windows.x.motif.
  566.  
  567. These files are also accessible from WAIS (Wide Area Information System) under
  568. comp.windows.x.motif, allowing keyword-based searches of the newsgroup
  569. articles (this time on machine services.canberra.edu.au (137.92.1.12)).
  570.  
  571. -----------------------------------------------------------------------------
  572. Subject: 11)  Is the mail list motif-talk archived?
  573.  
  574. Answer: If you have purchased support from OSF then you have access to their
  575. archive server for motif-talk.
  576.  
  577. -----------------------------------------------------------------------------
  578. Subject: 12)  TOPIC: OSF, MOTIF and COSE
  579.  
  580. -----------------------------------------------------------------------------
  581. Subject: 13)  What versions of Motif are there?
  582.  
  583. [Last modified: Sept 94]
  584.  
  585. Answer: Motif 1.0 is based on the R3 toolkit.  There are patch releases to
  586. 1.0: 1.0.1, 1.0.A, 1.0.2 and 1.0.3, 1.0.4, 1.0.5. 1.0.A was a fairly major
  587. patch, as it involved a complete re-engineering of UIL and Mrm.  Almost
  588. everyone who has 1.0.x has either 1.0.A or 1.0.3.
  589.  
  590. Motif 1.1 is based on the R4 toolkit.  The intial version was Motif 1.1.0.
  591. Motif 1.1.1 has been released as a patch to licensees with Full Support or
  592. Technical Update service.  Motif 1.1.2 is a patch release which contains the
  593. necessary changes to fix over 80 bugs reported against Motif. It is available
  594. to support contract holders (including both full support and update service).
  595. The 1.1.3 release fixed a further 150 bugs and was available from August 1991
  596. to support contract holders (including both full support and update service).
  597. 1.1.4 offers X11R5 support, but is not an X11R5 product.  1.1.5 was released
  598. in June 92 to licensees who hold a Motif Full Support or Update Support
  599. contract
  600.  
  601. Motif 1.2.0 was released in April 1992 and is based on the X11R5 toolkit.  It
  602. offers increased compatibility with international standards,  PC-style
  603. behavior and binary compatibility with OSF/Motif 1.1 applications.  New
  604. features include drag-and-drop, tear- off menus, toolkit enhancements and new
  605. documentation.  toolkit.  The code is totally ANSI C.  OSF distributes a 10
  606. pages sheet entitled "OSF/Motif R1.1 to R1.2: detailed overview of changes",
  607. which is available from OSF Motif direct channels.  (617-621-7300 or email
  608. direct@osf.org)
  609.  
  610. Motif 1.2.1 was released September 92.  Due to an optimisation from 1.2.0 to
  611. 1.2.1 object code compiled under 1.2.1 (that is, using 1.2.1 header files)
  612. will not link with 1.2.0 libraries (and, very probably, clients that use
  613. shared libraries and are linked against 1.2.1 won't startup against 1.2).
  614.  
  615. Motif 1.2.2 was released March 93.  This release contains over 250 bug fixes,
  616. improved text, drag-and-drop features and has less than one reported defect
  617. per 1000 lines of code.
  618.  
  619. from dbrooks@osf.org Motif 1.2.3 was released on September 13, 1993.  The
  620. defect density is measured at < 0.8 known reports per thousand lines.  In this
  621. release, we have paid particular attention to memory leaks, and have improved
  622. drag-and-drop performance greatly.
  623.  
  624. Motif 1.2.4 was released April '94.  From the OSF README: This patch release
  625. contains approximately 240 bug fixes for Motif 1.2. The number of CRs resolved
  626. in this release is about 330....Apart from the 64-bit changes, all changes
  627. made in this release are fixes for reported bugs.
  628.  
  629. Motif 2.0 was released in August '94.
  630.  
  631. For details, see the questions "Is there a concise features list for Motif
  632. 2.0?" and "What are the details about new features in Motif 2.0?"
  633.  
  634. -----------------------------------------------------------------------------
  635. Subject: 14)  Is there a concise features list for Motif 2.0?
  636.  
  637. [Last modified: Sept 94]
  638.  
  639. Answer: (See the next question for a more detailed features list.)
  640.  
  641. The following list is the OSF documentation located at the WWW URL:
  642.  http://www.osf.org:8001/motif/list_features.html
  643.  
  644. "Complete list of 2.0 features"
  645.  -----------------------------
  646.  
  647. New widgets
  648.  
  649.    ComboBox.
  650.    Notebook.
  651.    Container/IconGadget.
  652.    SpinBox.
  653.    CSText.
  654.  
  655. New features
  656.  
  657.    Thermometer Scale and tic marks.
  658.    ScrollBar sliding/arrow and snapback modes.
  659.    ScrolledWindow autoscroll and childType.
  660.    Toggle indeterminate state and new visual.
  661.    Colors in Gadgets.
  662.    XmIm API for I18N.
  663.    XmNlayoutDirection resource everywhere.
  664.    Natural UnitType conversion syntax.
  665.    XPM3 (colored icon) format support.
  666.    The Uniform Transfer Model.
  667.    General Rendition attributes in XmString (color, multiple fonts, etc)
  668.    Several Display resources for CDE visual/behavior compatibility.
  669.    New FileSelectionBox mode (again from CDE).
  670.    Quick navigate in List.
  671.    Oriented PanedWindow.
  672.    Popup menus support.
  673.    and much more...
  674.  
  675. Extensibility
  676.  
  677.    Traits.
  678.    C++ foundry.
  679.    Widget writer doc.
  680.    Exm widget source examples.
  681.    Xme API (useful _Xm).
  682.  
  683. Desktop
  684.  
  685.    Virtual MWM.
  686.    Workspace Manager.
  687.    TearOff menu in MWM.
  688.    Client Command Interface.
  689.    Colored icon pixmaps (from Xm).
  690.  
  691. Performance & Quality
  692.  
  693.    No known Memory Leaks.
  694.    XmString sharing.
  695.    XmList creation/setup speedup.
  696.    GC usage improved.
  697.    Malloc/free usage.
  698.    Bitmap allowed for pixmap resources.
  699.    XmManager no longer blindly selects for PointerMotion
  700.    XmFileSelectionBox better stat cache.
  701.    Broader use of Hash tables.
  702.    Better link profile (Trait + remodularization).
  703.    X11R6 unofficial support.
  704.    Hundreds of bug fixes.
  705.  
  706. -----------------------------------------------------------------------------
  707. Subject: 15)  What are the details about new features in Motif 2.0?
  708.  
  709. [Last modified: Sept 94]
  710.  
  711. Answer: (See the previous question for a more compact features list.)
  712.  
  713.         NOTE: This is a posting by Douglas Rand that was composed by
  714.         one of the OSF business managers, Darrell Crow (crow@osf.org).
  715.         Also, OSF maintains its own Motif 2.0 FAQ:
  716.         http://www.osf.org:8001/motif/MotifFAQ.html ...ksall@cen.com
  717.  
  718.  Date: 11 Jul 94 15:49:27 GMT
  719.  From: uunet!ucbvax.Berkeley.EDU!agate!howland.reston.ans.net!spool.mu.edu!bloom-beacon.mit.edu!paperboy.osf.org!usenet (Douglas Rand)
  720.  Organization: Open Software Foundation
  721.  Subject: Motif 2.0 announcement
  722.  To: uunet!lobo.gsfc.nasa.gov!motif
  723.  
  724.  
  725. The following was composed by one of our business managers, Darrell Crow
  726. (crow@osf.org),  questions may be directed to him.
  727.  
  728. ----------------------------------------
  729.  
  730. With this posting I hope to answer many questions I've been receiving
  731. regarding what is in Motif 2.0 and how does if differ from Release 1.2.  This
  732. posting contains an overview followed by a bullet item listing of the features
  733. and benefits added to Motif in this release. If I didn't answer your questions
  734. feel free to direct them to me.  At the end, I'll list additional
  735. documentation available from OSF.  If you're also interested in the licensing
  736. and pricing information you can also contact me or the official OSF/Motif
  737. channel: direct@osf.org.  I hope that this information update is of benefit to
  738. you.
  739.  
  740. OSF/Motif has become the major Graphical User Interface (GUI) technology for
  741. Open Systems, as well as an IEEE 1295 standard.  On Tuesday, June 21, OSF
  742. announced its next major release of OSF/Motif, Release 2.0.   This release,
  743. which is the most extensive and colaborative release of Motif since Motif 1.0
  744. was introduced five years ago, includes new features organized around four
  745. major themes:
  746.         I.  Extensibility,
  747.         2.  Consistency,
  748.         3.  Improvements and
  749.         4.  CDE Convergence.
  750.  
  751. Motif 2.0 was a collaborative development effort.  Contributors to this
  752. release include Lotus Development, IBM, Hewlett-Packard, Digital Equipment,
  753. Integrated Computer Solutions, Computer Automation,  Groupe Bull, HaL Computer
  754. Systems and Unix Systems Laboratories.
  755.  
  756. This release had the goal of allowing developers to easily build new widgets
  757. and with support for C++ .  This required new extensible features such as
  758. subclassing, traits, C++ support and detailed documentation.  Like all Xt-
  759. based toolkits, subclassing requires detailed knowledge, experience and access
  760. to the source code to fully understand Motif's class methods.  Motif 2.0
  761. simplified this process by providing extensive documentation and allowing
  762. subclassing from the Primitive and Manager classes without requiring access to
  763. source code. Documentation of Motif's class methods are included in a new
  764. book, The OSF/Motif Widget Writer's Guide. This book provides all necessary
  765. information to subclass from Primitive and Manager and numerous examples of
  766. subclassing are provided.   Traits are a new feature with Motif 2.0 which
  767. essentially allow a given behaviour to be associated to a widget irrespective
  768. of the widget hierarchial relationships. The number of applications developped
  769. in C++ is rapidly growing and C++ programmers are now able to derive new
  770. subclasses and still have those C++ widgets usable as regular widgets with the
  771. standard API in Motif 2.0
  772.  
  773. CDE (Common Desktop Environment) convergence.  The previous version of
  774. OSF/Motif (Release 1.2) introduced major new features such as
  775. internationalization, drag-and-drop and tear-off menus. Those features were
  776. intended to allow application developers to produce interoperable, easy to use
  777. applications for a worldwide market. As a result, this technology was selected
  778. to become the basis of the Common Desktop Environment jointly developed by HP,
  779. IBM, Novell and SunSoft, proposed to become an X/Open standard. These features
  780. as well as the GUI extensions added to the CDE specifications have been added
  781. to Release 2.0.
  782.  
  783. PC Consistency has been a major theme of this release.  This includes
  784. improvements and completions to the toolkit that was begun with Motif 1.2 as
  785. well as the addition of seven new widgets (Container, Notebook, icon gadget,
  786. spinbox, combobox, CSText and thermometer) common to this environment and
  787. finally a new Style Guide.  Extensive work has been expended to ensure the
  788. convergence of the Windows, CUA, CDE and Motif style both in technology and
  789. terminology into a single document.  The work for this book will be submitted
  790. to the X/Open Fast Track process for incorporation into the X/Open set of
  791. specifications.
  792.  
  793. Improvements to the OSF/Motif toolkit are far too numerous to adequately list
  794. here.  However a brief mention of a few of the major improvements includes the
  795. addition of the Unified Transfer Model that simplifies data transfer by all
  796. Motif's previous methods,  XPM support (ability to read colored icon file for
  797. pixmap resources), ScrolledWindow partial scroll and autodrag,Toggle
  798. checkmark, indeterminate state, documenting the input methods API for
  799. internationalization, upgrading UIL to support 64-bit architecture, platform
  800. independence, and support of the new extensibility features and widgets, and
  801. finally the Motif Window Manager support of virtual screen, workspace
  802. management protocol and root menu additions and etc.
  803.  
  804. This release brings together the most requested features from development
  805. community with the single purpose of extending application developers' mission
  806. of producing portable, consistent and interoperable applications to the open
  807. systems  community.
  808.  
  809. Listing of the OSF/MotifR 2.0 Features and Benefits
  810.  
  811. I.  MORE EFFICIENT APPLICATION DEVELOPMENT
  812.  
  813. Easier application development to meet new business opportunities and deploy
  814. applications faster...
  815.  
  816. Benefit Allows easier extensions to Motif for custom user
  817.  
  818.  
  819. Features:
  820. *  New, formal Xme API for integrating custom widgets interfaces,
  821.    without access to Motif source code
  822. *  All extensions using Xme API are "full citizens"
  823. *  Widgets may be added to off-the-shelf Motif products, without
  824.    recompiling Motif source code
  825. *  Manager and primitive widget subclassing
  826. *  C++ base classes provided for C++ widget development
  827. *  C++ is used for inheritance, but X intrinsics are used for other
  828.    characteristics
  829. *  Trait mechanism for OSF/Motif widgets, allowing "multiple
  830.    inheritance" of C class methods
  831. *  Extensibility fully documented in Widget Writer's Guide, and
  832.    Reference documentation
  833. *  New OSF training: Widget Writing with Motif 2.0
  834. *  Examples of custom widgets in C and C++
  835.  
  836. Feature:
  837. Makes it easier for C++ developers to use Motif
  838.  
  839. Benefit:
  840. *  Motif source code compilable by C++ compiler
  841. *  Ability to integrate C++ widget extensions (above)
  842.  
  843. Feature:
  844. Allows easier exploitation of Motif features for end user benefits
  845.  
  846. Benefit:
  847. XmNotebook
  848. *  Subclass of XmManager
  849. *  Organizes children into pages, tabs, status area and page scroller
  850. XmContainer
  851. *  Subclass of XmManager
  852. *  Manages IconGadget children
  853. XmIconGadget
  854. XmComboBox
  855. *  Subclass of XmManager
  856. *  Combines capabilities of a single line
  857.         XmTextField and XmList
  858. XmSpinBox
  859. *  Subclass of XmManager
  860. *  Manages multiple traversable children
  861. XmScale (thermometer) widget
  862. *  Subclass of XmManager
  863. *  New resources added for thermometer behavior
  864. XmCSText
  865. *  Subclass of XmPrimitive
  866. *  Provides facilities which parallel XmText, but using XmString
  867.  
  868. Uniform transfer model for primary transfer,
  869. *  secondary transfer, cut and paste, drag and drop
  870.         Uniform API (with backward compatibility)
  871.         2 new callback functions for target identifcation
  872.  
  873. Misc. toolkit enhancements:
  874. *  Menu system
  875.         Simplified programming of popup menus
  876.         Source code reorganization
  877. *  X pix map (XPM) format, with multicolor icons
  878.  
  879. Misc. toolkit enhancements (continued):
  880. *  New rendering characteristics for XmString:
  881.         renditions (fonts, color), tabs, localization
  882.         components, parsing
  883. *  List -- Quick navigate
  884. *  Traversal -- drawing area traversable via keys,
  885.         virtual key associated with multiple real keys
  886. *  Visuals (in addition to Toggle Button)
  887. *  XmScreen resources
  888. *  Resolution independence -- unit conversion
  889.  
  890. UIL enhancements:
  891. *  Support for new and custom widgets
  892. *  UID files -- platform independence
  893. *  64-bit architecture support
  894.  
  895. Updates to documentation: Programmer's Guide, Reference
  896.  
  897. Updates to OSF training:
  898. *  Introduction to Programming
  899. *  User Interface Design
  900. *  2.0 Technical Update
  901.  
  902. Feature:
  903. Allows easy integration of applications with Common Desktop
  904. Environment (CDE)
  905.  
  906. Benefit:
  907. *  Contains foundation GUI for CDE
  908. *  Client-command interface allowing other clients to add commands to
  909. MWM menus
  910.  
  911. Feature:
  912. Allows easy migration of applications to Motif 2.0
  913.  
  914. Benefit
  915. *  Upward binary compatibility of Motif 1.2 toolkit API
  916.         (Motif 1.2 applications need only re-link)
  917.  
  918. Feature
  919. Makes applications easier to troubleshoot & maintain
  920.  
  921. Benefit
  922. *  Overall quality improvements in Motif
  923. *  Default density lower than 0.5 DPKLOC
  924.  
  925. EASE OF USE
  926.  
  927. Ease of use by individual computer users... at the application user
  928. interface level...
  929.  
  930. Feature:
  931. Satisfies rising user expectations for ease of use, leveraging
  932. experience with other user interfaces
  933.  
  934. Benefit:
  935. User interface capabilities equivalent to those on PCs:
  936. *  Notebook widget
  937. *  Container widget
  938. *  ComboBox widget
  939. *  SpinBox widget
  940. *  Scale (thermometer) widget
  941. *  Availability of formatted editable text
  942.         Compound String text widget
  943.         Compound String enhancements to support color, tabs, multiple
  944.           fonts, etc.
  945. *  Auto Scrolling
  946. *  Vertical Paned Window
  947. *  Update to User Guide
  948.  
  949. Ease of use by individual computer users... at the desktop level...
  950.  
  951. Feature:
  952. Allows easier integration with the desktop
  953.  
  954. Benefit:
  955. *  Contains foundation GUI for Common Desktop Environment (CDE)
  956. *  Tear-off menu support of mwm's root menu
  957.  
  958. Feature:
  959. Allows more natural organization of users' work
  960.  
  961. Benefits:
  962. *  Virtual screen (desktop panning) support
  963. *  Workspace management protocol
  964.         (for third party workspace management solutions that
  965.         allow users to switch computing context "rooms" for
  966.         different tasks)
  967.  
  968. EASE OF ENTERPRISE COMPUTING
  969.  
  970. Easier integration of Motif  and Motif applications into the
  971. enterprise computing environment...
  972.  
  973. Feature:
  974. Increases consistency of user interface style across platforms &
  975. applications; increases user skill portability
  976.  
  977. Benefits:
  978. *  Motif 2.0 Style Guide work Technical and terminology convergence
  979.         among Motif, CDE and CUA
  980. *  New widget support of converged style
  981. *  Increased similarity to Windows & CUA behavior:
  982.         Check marks and crosses in Toggle Button
  983.         Indeterminate state in Toggle Button
  984.         Ctrl Button 1 takes focus
  985.         Menu unpost behavior
  986.         Quick navigate in list
  987.  
  988. Feature:
  989. Increases consistency of a complete user environment across open
  990. systems
  991.  
  992. Benefits:
  993. *  Consistency with the X/Open CDE specification, including virtually
  994.         all CDE Motif vendor extensions:
  995.         XmCascadeButton activation via BMenu
  996.         Enhanced XmFileSelectionBox
  997.         Default XmNshadowThickness to 1
  998.         Thermometer-style XmScale
  999.         Color pixmaps in XPM format
  1000.         Additional virtual key bindings
  1001.         SpinBox, ComboBox
  1002.         Message catalogs for toolkit error messages
  1003.         Other items controlled by a global resource:
  1004.           ColorObject (standarizes colormap allocation for
  1005.            applications, to enable use of Style Manager application)
  1006.         BSelect and BTransfer integration
  1007.         Dragging non-selectable items disabled
  1008.         Use of TAB key -- XmPushButton navigation
  1009.         Visual additions to XmToggleButton
  1010.         Visual modifications to menus (etched in)
  1011.         Visual modifications to default button in dialogs (focus
  1012.           highlight outside of default visual)
  1013.         Visual modifications to MWM
  1014.         Additional drag icons
  1015. *  Compliance with IEEE 1295 standard
  1016. *  Consistency of Motif vendor implementations:
  1017.         AES Rev D for API stability
  1018.         Validation Test Suite 2.0 for certification
  1019.         Updated Quality Assurance Test Suite for consistency in
  1020.           quality
  1021. *  Continued support of the X Window system (based on
  1022. *  X11R5; tested also with X11R6 )
  1023.  
  1024. Feature:
  1025. Ease of integrating Motif and PC environments
  1026.  
  1027. Benefits:
  1028. *  Favorable licensing terms to support:
  1029.         PC client-server computing
  1030.         Deployment of PC applications using Motif DLLs
  1031. *  Style convergence to support hybrid user environments
  1032.  
  1033.  
  1034. WORLD-WIDE ACCEPTANCE
  1035.  
  1036. Even more acceptable as the preferred user interface for Open Systems,
  1037. worldwide...
  1038.  
  1039. Feature
  1040. Applicable to a wider range of computer users
  1041.  
  1042. Benefits:
  1043. *  Internationalization enhancements:
  1044.         New API for widget writers to make use of input methods
  1045.         Higher level of internationalization for Middle Eastern
  1046.           languages:
  1047.         Bi-directional layout -- left-to-right/right-to-left geometry
  1048.           management
  1049.         Bi-directional text editing -- left-to-right/right-to-left,
  1050.           single level (unsupported)
  1051. *  64-bit architecture support
  1052. *  Favorable licensing terms to support:
  1053.         Single user systems
  1054.         Embedded systems
  1055.         Cross-vendor Motif upgrades
  1056.         Shared library distribution with applications
  1057. *  Performance
  1058.         Memory usage
  1059.         Start-up time, for list widget
  1060.         Decreased X resource usage
  1061.         Various optimizations
  1062.  
  1063.  
  1064. ADDITIONAL AVAILABLE DOCUMENTS FROM OSF.
  1065.         OSF/Motif 2.0 Datasheet
  1066.         OSF/Motif 2.0 Price List
  1067.         OSF/Motif 2.0 Licensing Kit
  1068.         OSF/Motif 2.0 Laymen's Explanation
  1069.         OSF/Motif 2.0 FAQ
  1070.         X/Journal July-August Feature Article on Motif 2.0
  1071.  
  1072. FOR MORE INFORMATION ABOUT OSF/MOTIF 2.0, PLEASE CONTACT OSF DIRECT CHANNELS
  1073. AT: (617)621-7300; email: direct@osf.org
  1074.  
  1075. OSF and Motif are registered trademarks of the Open Software Foundation, Inc.
  1076.  
  1077.  [end of message from Darrell Crow (crow@osf.org)]
  1078.  
  1079. -----------------------------------------------------------------------------
  1080. Subject: 16)+ Where can I find Motif 2.0 documentation?
  1081.  
  1082. [Last modified: Feb 95]
  1083.  
  1084. Answer: The Motif 2.0 README file says:
  1085.          The complete Motif documentation set is made up of the
  1086.          following documents:
  1087.  
  1088.             o Application Environment Specification - User
  1089.               Environment Volume
  1090.             o OSF/Motif Programmer's Reference
  1091.             o OSF/Motif Programmer's Guide
  1092.             o OSF/Motif Release Notes
  1093.             o OSF/Motif Style Guide
  1094.             o OSF/Motif User's Guide
  1095.             o OSF/Motif Widget Writer's Guide
  1096.  
  1097.          These documents are contained in one of the major
  1098.          subdirectories (./doc) of the Release 2.0 tree.
  1099.  
  1100. For more Details, see Chapter 7 of the README file at the top level of the
  1101. Motif 2.0 source tree.
  1102.  
  1103. -----------------------------------------------------------------------------
  1104. Subject: 17)* Where can I get Motif?
  1105.  
  1106. [Last modified: Feb 95]
  1107.  
  1108. Answer:
  1109.     Various hardware vendors produce developer's toolkits of binaries, header
  1110. files, and documentation; check your hardware vendor, particularly if that
  1111. vendor is an OSF member. Systems known to be shipping now: HP, SCO, ICS, Mips
  1112. (RISCwindows=X11R3 + full Motif), IBM, Data General for AViioNs (includes
  1113. UIL), Bull (?), Concurrent Computer Corporation 5000, 6000, 8000 series
  1114. machines, Convex, Sequent.
  1115.  
  1116.     In addition, independent binary vendors produce Motif toolkits .
  1117.  
  1118. [A FAQ is for "personal opinions" on these toolkits.  I don't think it is
  1119. appropriate to give such opinions through this particular posting, so I
  1120. haven't included any.]
  1121.  
  1122. Integrated Computer Solutions, Inc. (ICS) 201 Broadway, Cambridge, MA  02139
  1123. USA info@ics.com   617/621-0060
  1124.  
  1125. ICS provides binary distributions of Motif for Sun platforms.  Other platforms
  1126. are available as well, call or send mail for current info.  ICS also provides
  1127. in-depth programming support for Motif and additional tools such as Builder
  1128. Xcessory, a Motif interface builder, and the Widget Databook, a source for
  1129. third party, commercially available and supported widgets, class libraries,
  1130. and subsystems.
  1131.  
  1132. Quest (408-496-1900) sells kits for Suns, as well;
  1133.  
  1134. IXI offers Motif 1.2.4 for HP-UX, IBM AIX, SunOS and Solaris (SPARC and
  1135. Intel).  You can contact IXI at:
  1136.  
  1137.     IXI Corporation          IXI Limited          IXI Japan
  1138.     400 Encinal Street       Vision Park          24-3 Oohashi 2 Chome
  1139.     Santa Cruz               Cambridge            Meguro-ku
  1140.     California               CB4 4ZR              Tokyo 153
  1141.     CA 95061-1900            England              Japan
  1142.  
  1143.     Tel: (408) 427 7700      +44 (0)1223 518000   +81 3 5486 2155
  1144.     Fax: (408) 427 5407      +44 (0)1223 518001   +81 3 5486 1833
  1145.  
  1146. Advanced User Systems Pty Ltd is an Australian distributor of IXI Limited
  1147. (X.desktop, Motif, Wintif, Panorama) as a User Pack or Developer Pack, full
  1148. technical support, and updates:
  1149.  
  1150.     Advanced User Systems Pty Ltd           info@aus.oz.au
  1151.     2 Rudd Street
  1152.     North Ryde NSW 2113
  1153.     Australia
  1154.     Ph:  +61 (0)2 878-4777
  1155.     Fax: +61 (0)2 878-6951
  1156.  
  1157.  
  1158. Sun Microsystems is now shipping IXI Motif 1.2.2.
  1159.  
  1160. NSL (+33 (1) 43 36 77 50; requests@nsl.fr) offers kits for Sun4.
  1161.  
  1162. Carsten Hammer Schwindstr (chammer@POST.uni-bielefeld.de) reports that he
  1163. could not find Motif for a Sun3 from any vendor.
  1164.  
  1165.  
  1166. In Australia, Information Technology Consultants Pty Ltd has Motif 1.1.2 for
  1167. Sun Sparc 4.1 ( phone on (02) 360 6999, fax on (02) 360 6695 or e-mail to
  1168. motif@itcsyd.itc.oz.au)
  1169.  
  1170. SILOGIC (+33 61.57.95.95), 78 chemin des Sept Deniers - 31200 TOULOUSE FRANCE
  1171. sells Motif 1.1 and 1.2 on Sun4 machines. They also provide customers with
  1172. Motif maintenance and support, and do consulting on the X window System at
  1173. large, including software development.
  1174.  
  1175. Metro Link Inc., has Motif Runtime and Development packages available for a
  1176. variety of operating systems:  AT&T SVR3.2, ISC, Linux, LynxOS, QNX, SCO,
  1177. SINIX, Solaris, SunOS, SVR4, UnixWare, and Venix.  All versions ship with
  1178. shared library version of libXm.
  1179.  
  1180. Metro Link Inc.  4711 N. Powerline Rd., Ft. Lauderdale, Florida  33309 Voice:
  1181. +1.305.938.0283  Fax: +1.305.938.1982  Email: sales@metrolink.com
  1182.  
  1183. BIM (Fax : +32(2)759.47.95) offer Motif 1.1 for Sun-3, Sun-4, Sun-386i.
  1184.  
  1185.  
  1186. Includes shared libraries.
  1187.  
  1188. An OSF/Motif source license must be obtained from OSF before source can be
  1189. obtained from the Open Software Foundation. Call the Direct Channel Desk at
  1190. OSF at 617-621-7300 or email direct@osf.org for ordering information.  In
  1191. addition to the full Motif source, "option C" allows you to purchase source
  1192. for the window manager mwm to run on X terminals.
  1193.  
  1194. Bluestone offers Motif for $99.  Bluestone's  MWM is the compiled version of
  1195. OSF/ Motif for Sun/SPARC. It is plain vanilla Motif based on X11 and Xt
  1196. Intrinsics.  There is no license manager.  Platforms: Sun/OS 4.1+ and Solaris
  1197. V2.1,2.2. Contact: Bluestone @609-727-4600
  1198.  
  1199. -----------------------------------------------------------------------------
  1200. Subject: 18)  Is there a list of Motif bugs?
  1201.  
  1202. Answer: With each patch release of Motif shipped, there is a list of known
  1203. bugs provided.  The filename on the tape is "./OPENBUGS".  There is also a
  1204. list of all the issues closed/resolved in that patch.  That is found as part
  1205. of the "./README-1.1.n" (where n is the patch number) file.
  1206.  
  1207. These are the only OSF published lists.
  1208.  
  1209. No one else seems to publish a list.
  1210.  
  1211. -----------------------------------------------------------------------------
  1212. Subject: 19)  What is COSE and how does it relate to Motif?
  1213.  
  1214. [Last modified: Sept 94]
  1215.  
  1216. Answer:
  1217.  
  1218.         NOTE: This info dates back to a Nov. '93 conference.
  1219.         Most of the words should be credited to the lecturer,
  1220.         Nicholas J. Aiuto (nick@ps.quotron.com) of Cadence Design Systems, Inc.
  1221.         Any mistakes or inaccuracies are mine, however.
  1222.         I would appreciate updates and corrections...ksall@cen.com
  1223.  
  1224.  
  1225. COSE is Common Open Software Environment, a major interoperability effort
  1226. started by HP, Sun, Novell/UNIX System Labs (USL), IBM, and SCO, with over 70
  1227. other companies pledging their support. The COSE announcement was made in
  1228. March, 1993 and a "COSE CDE Conference" was held in San Jose in October, 1993.
  1229.  
  1230. CDE is the Common Desktop Environment component of COSE. CDE is "a
  1231. specification for components and services to give the UNIX desktop common and
  1232. consistent capabilities like those found in other widely used environments
  1233. (Mac, Windows)." [from class notes] CDE is not public domain; it will be
  1234. provided by major vendors, possibly at extra cost as unbundled s/w
  1235. approximately mid 1994.  CDE will be based on Motif 1.2 and X11R5, although
  1236. Motif 2.0 and X11R6 are expected around the same time. (CDE will be ported to
  1237. Motif 2.0 eventually.)
  1238.  
  1239. A CD-ROM was distributed at the October, 1993 conference, but this was "alpha"
  1240. s/w, strictly for evaluation purposes, not for development.
  1241.  
  1242. Another COSE/CDE Snapshot CD-ROM was released in April '94, available for HP,
  1243. IBM, Novell, and Sun platforms.
  1244.  
  1245. Overview
  1246. --------
  1247.  
  1248. Standards are to be defined in these areas:
  1249.  
  1250.         - desktop
  1251.         - networking
  1252.         - objects
  1253.         - graphics
  1254.         - system management
  1255.  
  1256. CDE Functional Groups:
  1257.  
  1258.     High Level:
  1259.         - Desktop Management
  1260.         - Productivity Tools
  1261.  
  1262.     Low Level:
  1263.         - GUI Display and Printing
  1264.         - Application Integration
  1265.         - "Guidelines": a 100+ pg. checklist which is a superset of Motif's
  1266.  
  1267. CDE Desktop Management
  1268. ----------------------
  1269.  
  1270.  - Login Manager: like xdm
  1271.  - Session Manager: saving state based on ICCCM and HP's VUE [vuesession]
  1272.  - Workspace Manager: virtual screens; rooms; virtual win mgr
  1273.  - Front Panel: object and window management; access to favorite apps
  1274.  - File Manager: icon drag and drop
  1275.  - Application Manager
  1276.  - Style Manager: configure Session Mgr (colors, fonts, HOME session)
  1277.  
  1278. Productivity Tools
  1279. ------------------
  1280.  
  1281.  - Text Editor: based on XmText widget; not very fancy
  1282.  - Icon Editor: color pixmaps; based on HP's vueicon; need 16 icons per app
  1283.  - Help Viewer: can access app help without running application
  1284.  - Mailer and Calendar: can talk to each other
  1285.  - Terminal Emulator: improvement on xterm
  1286.  - Calculator
  1287.  - Create "Action": something you tell your system to do and associate with
  1288.                    a specific icon (e.g., starting a favorite app); can also
  1289.                    tag a specific command line and add to your desktop
  1290.  
  1291. GUI Display and Printing
  1292. ------------------------
  1293.  
  1294.  - Motif 1.2 with extras, X11R5
  1295.  - New widgets (subclasses of similar widgets to be in Motif 2.0):
  1296.         o  ComboBox
  1297.         o  SpinButton
  1298.  
  1299.  - dtksh: windowing Korn shell, a robust UNIX shell interface to X, Xlib, and
  1300. Xm
  1301.  - Application Builder: port of Sun's DevGuide [not yet available]
  1302.  - X Print Server and X Server Print Extension
  1303.  
  1304. Application Integration
  1305. -----------------------
  1306.  
  1307.  - Data Interchange
  1308.         o  Drag and Drop (DND): based on Motif 1.2 with improvements
  1309.         o  Bento container format:
  1310.                 "Japanese lunchbox"
  1311.                 compartmented container developed by Apple;
  1312.                 stores compound document on disk;
  1313.                 apps can find audio compartment, for example
  1314.                 100-page document describes Bento
  1315.  - ToolTalk
  1316.         o  messaging/IPC facility developed by Sun
  1317.         o  CDE message sets (sample msgsd: iconify yourself, close down, etc.)
  1318.  - Actions
  1319.         o define what can be done with files or arbitrary data (e.g., audio)
  1320.  - Data Typing
  1321.         o define data classes for objects (e.g., PS file, C source code)
  1322.  
  1323. Guidelines
  1324. ----------
  1325.  
  1326.  - Common Fonts (about 16): proportional, monospaced, with or without serif
  1327.  - Internationalization (I18N) compliance
  1328.  - Client/Server
  1329.         o Network execution model
  1330.         o end user model
  1331.         o system admin model: facilitates easy installation of new
  1332.                               CDE-compliant apps
  1333.         o ISV model
  1334.  - Certification Checklist: 100 pages; superset of Motif 1.2 Certif. Checklist
  1335.  
  1336.  
  1337. -----------------------------------------------------------------------------
  1338. Subject: 20)+ Is there a CDE FAQ or newsgroup?
  1339.  
  1340. [Last modified: Feb 95]
  1341.  
  1342. Answer: The COSE FAQ is located at:
  1343.  
  1344.    http://proper.com:70/0/faqs-link/common-faqs/faqs/cde-cose-faq or
  1345.    http://www.cis.ohio-state.edu/hypertext/faq/usenet/cde-cose-faq/faq.html
  1346.  
  1347. There is also a newsgroup called news:alt.windows.cde
  1348.  
  1349. -----------------------------------------------------------------------------
  1350. Subject: 21)  What is PST?
  1351.  
  1352. [Last modified: Dec 94]
  1353.  
  1354. A.  Kristen Knotts <uunet!osf.org!kjk> writes:
  1355.  
  1356. PST stands for Pre-structured Technology.  This is a new process, which
  1357. evolved from the 1993 COSE (Common Open Software Environment) initiative, used
  1358. by the Open Software Foundation (OSF) to procure and deliver technology to the
  1359. industry more quickly than the existing Request For Technology (RFT) process.
  1360.  
  1361. For more information on OSF and its acronyms (e.g., PST, RFT, RFC), contact
  1362. OSF Direct (direct@osf.org) or literature-request@osf.org.
  1363.  
  1364. -----------------------------------------------------------------------------
  1365. Subject: 22)  Does OSF's PST process impact CDE evolution?
  1366.  
  1367. [Last modified: Dec 94]
  1368.  
  1369. A.  In response to some questions from Marc Prokop (prokop@acri.fr), Elizabeth
  1370. Connolly of Open Software Foundation wrote:
  1371.  
  1372.  
  1373. You're correct that CDE (1.0) was developed on Motif 1.2.  You're also
  1374. correct that OSF included in Motif 2.0 several extensions to Motif 1.2 that
  1375. were made by the CDE 1.0 implementors.  Despite OSF's inclusion of these
  1376. extensions, OSF is not involved in CDE 1.0 development.
  1377.  
  1378. As you may know, OSF has a new process, called the Pre-Structured
  1379. Technology (PST) process, for joint development projects.  Further
  1380. evolution of both CDE and Motif (that is, beyond CDE 1.0 and Motif 2.0)
  1381. is expected to be handled under this process.  In fact, a group of
  1382. companies is at work now on a PST proposal for submission to the OSF Board
  1383. of Directors.  Such a PST would provide for management of the
  1384. "compatibility" between Motif and CDE.
  1385.  
  1386. You could acquire more information about CDE 1.0 by querying one of
  1387. the companies involved in CDE 1.0 (HP, IBM, Novell, and Sunsoft.)
  1388.  
  1389.  
  1390. -----------------------------------------------------------------------------
  1391. Subject: 23)  Because of COSE, is Motif now in the public domain?
  1392.  
  1393. Answer: The *specification* for Motif is no longer controlled by OSF, but by
  1394. X/Open.  This does not affect the *implementation*. The implementation is
  1395. still in the hands of OSF, and will not be released into the public domain.
  1396. So no, the OSF source code will still only be available to those who buy a
  1397. source code license from OSF.
  1398.  
  1399. The specification does not include UIL or obsolete features (ie 1.0 bugs in
  1400. design), but these will continue to be supported by the OSF code.
  1401.  
  1402. -----------------------------------------------------------------------------
  1403. Subject: 24)  What is DCE?
  1404.  
  1405. [Last modified: Dec 94]
  1406.  
  1407. A.  From  "The Free On-line Dictionary of Computing"
  1408. (http://wombat.doc.ic.ac.uk/) by Denis Howe <dbh@doc.ic.ac.uk>:
  1409.  
  1410. (DCE) An architecture consisting of standard programming interfaces,
  1411. conventions and server functionalities (eg. naming, distributed file system,
  1412. remote procedure call) for distributing applications transparently across
  1413. networks of heterogeneous computers. DCE is promoted and controlled by the
  1414. Open Software Foundation (OSF).
  1415.  
  1416. From Kristen Knotts <uunet!osf.org!kjk>:
  1417.  
  1418. NEWTON, MA, November 1, 1994 -- The Open Software Foundation today announced
  1419. the general availability of Release 1.1 of the Distributed Computing
  1420. Environment (DCE).  This release includes,
  1421.  
  1422. - Major new enhancements to system administration, including a consolidated
  1423. interface for administration throughout DCE, plus a capability allowing for
  1424. the remote start-up and shut-down of remote services;
  1425.  
  1426. - Enhancements to security, including a Generic Security Service API (GSSAPI)
  1427. which allows non-RPC based systems to take advantage of DCE security, extended
  1428. registry attributes allowing various proprietary systems to be  registered in
  1429. the DCE security registry, as well as security delegation and auditing
  1430. capabilities;
  1431.  
  1432. - Enhancements to internationalization which include standardized POSIX and
  1433. X/Open interfaces and provide character code set  interoperability and
  1434.  
  1435. - General performance enhancements.
  1436.  
  1437. Contact:  Jane Smeloff, Open Software Foundation, (617) 621-8997
  1438.  
  1439. -----------------------------------------------------------------------------
  1440. Subject: 25)  Where can I get public domain Motif source?
  1441.  
  1442. Answer: You cannot.  Motif source is not publically available.  However, see
  1443. "Has anyone done a public domain Motif lookalike?"
  1444.  
  1445.  
  1446. -----------------------------------------------------------------------------
  1447. Subject: 26)  Are Motif code examples publically available?
  1448.  
  1449. [Last modified: Oct 94]
  1450.  
  1451. Answer: OSF has produced a list of which of the example programs can be
  1452. distributed. Call OSF Direct for a copy of it.  Most of the example programs
  1453. have been freed from distribution limitations so should be available.
  1454.  
  1455. Source code posted to comp.sources.x often uses Motif.
  1456.  
  1457. In addition, many Motif programs are available via anonymous ftp from
  1458. ftp.x.org. The following are listed alphabetically by author.  (See the
  1459. "BOOKS" topic.)
  1460.  
  1461. If you don't understand the URL notation below, see 'What is an URL?' subject.
  1462.  
  1463. Thomas Berlages's book:
  1464.     ftp://ftp.x.org/R5contrib/berlage.motif.tar.Z
  1465.  
  1466. Dan Heller's book:
  1467.     ftp://ftp.x.org/R5contrib/OReilly/motif/examples.tar.Z
  1468.  
  1469. Donald L. McMinds's book:
  1470.     ftp://ftp.x.org/R5contrib/mastering.motif.tar.Z and
  1471.     ftp://ftp.x.org/R5contrib/master.1.2.tar.Z
  1472.  
  1473. Jan Newmarch's book:
  1474.     ftp://ftp.x.org/R5contrib/newmarch.tar.Z
  1475.  
  1476. Jerry Smith's book:
  1477.     ftp://ftp.x.org/R5contrib/smith.ooxt.tar.Z
  1478.  
  1479. Doug Young's source code for the current editions of his several books:
  1480.     ftp://ftp.x.org/contrib/book_examples/young.cxx.tar.Z
  1481.     ftp://ftp.x.org/contrib/book_examples/young2.motif.tar.Z
  1482.     ftp://ftp.x.org/contrib/book_examples/young.debug.tar.Z
  1483.  
  1484. Doug Young's examples for OLDER editions of his books:
  1485.     ftp://ftp.x.org/R5contrib/young.cxx.tar.Z
  1486.     ftp://ftp.x.org/R5contrib/young.motif.tar.Z
  1487.     ftp://ftp.x.org/R5contrib/young.motif2.tar.Z
  1488.     ftp://ftp.x.org/R5contrib/young.tar.Z
  1489.  
  1490. Examples appearing in "The X Resource" (by O'Reilly and Associates) appear
  1491. organized by issue in the directory:
  1492.     ftp://ora.com/pub/examples/xresource or:
  1493.     ftp://ftp.uu.net/published/oreilly/xresource
  1494.  
  1495. Examples from O'Reilly and Associates books can be found in subdirectories of:
  1496.     ftp://ora.com/pub/examples/xbook or:
  1497.     ftp://ftp.uu.net/published/oreilly/xbook
  1498.  
  1499.  
  1500. Also from a list maintained by: qizeng@acsu.buffalo.edu (Qi Y. Zeng) FTP sites
  1501. for X/MOTIF source code examples:
  1502.  
  1503.     ftp://ftp.uu.net/published/books/brain.motif.tar.Z
  1504.     ftp://ftp.uu.net/published/books/pwm-examples.tar.Z
  1505.  
  1506. Does anyone know what this is?
  1507.     ftp://ftp.x.org/R5contrib/pwm-xmpl.tar.Z
  1508.  
  1509. -----------------------------------------------------------------------------
  1510. Subject: 27)  Has anyone done a public domain Motif lookalike?
  1511.  
  1512. [Last modified: Oct 94]
  1513.  
  1514. Answer: The specification is available (AES), and the validation suite can be
  1515. bought, but no-one has taken up the challenge.  There are some commercial
  1516. lookalikes (Looking Glass and Neuron Data), but no workalikes.
  1517.  
  1518. Applications that follow the Style Guide might be certified Motif-compliant
  1519. through the checklist process, even though they're not using OSF/Motif
  1520. binaries.
  1521.  
  1522. Tcl/Tk is available for ftp from allspice.berkeley.edu, and although
  1523. implemented without Xt, has a "strict Motif" mode.
  1524.  
  1525. Strom Sytems (18666 Redmond Way o-2118, Redmond, WA 98052-6725) have a Simple
  1526. Toolkit for X-Windows (sic) that appears to follow the Style Guide even though
  1527. it doesn't quite look like Motif.
  1528.  
  1529. MOOLIT is a USL product that can be runtime switched between the Sun Open Look
  1530. and Motif appearance.  It is based on  OLIT 4i.
  1531.  
  1532. Interviews is a C++ based product with appearance similar to Motif.  A ftp-
  1533. able version is on interviews.stanford.edu.  A commercial version is available
  1534. as InterViews Plus.
  1535.  
  1536. Simon J. Lyall (simon@darkmere.midland.co.nz) reported about a package called:
  1537. Xu-lib & Widget Set- a library & widget set to "emulate" the look&feel and the
  1538. programming interface of OSF/Motif. Contact the author Udo Baumgart
  1539. (U.BAUMGART@ldb.han.de) for details.
  1540.  
  1541. -----------------------------------------------------------------------------
  1542. Subject: 28)  Does anyone from OSF pay attention to our questions/suggestions?
  1543.  
  1544. Answer: Yes, and they quite often post answers too. But they may not respond
  1545. to *your* problem because they have other things to do as well.  This
  1546. newsgroup is not run by OSF, and has no formal connection with OSF.  OSF is a
  1547. member-driven company.  The membership (and anyone can be a member) provides
  1548. the primary input for future development of Motif.
  1549.  
  1550. -----------------------------------------------------------------------------
  1551. Subject: 29)  Does OSF have an application compliance validation service?
  1552.  
  1553. Answer: They have a checklist and a certification process which you can
  1554. request from them.  Ask for the Level One Certification Checklist.  The
  1555. process is one of self-certification.  It tests only the appearance and
  1556. behavior of the application against Motif style.  The product will also be put
  1557. in the OSF reference listing.  There's a one-time fee of $250.  According to
  1558. the master license agreement, you can't use any OSF identifying mark unless
  1559. you have done a certification.
  1560.  
  1561. ----------------------------------------------------------------------------
  1562. END OF PART ONE
  1563. Archive-name: motif-faq/part2
  1564. Last-modified: FEB 11, 1995
  1565. Posting-Frequency: monthly
  1566. Organization: Century Computing, Inc.
  1567. Version: 4.1
  1568.  
  1569.  
  1570.  
  1571. -----------------------------------------------------------------------------
  1572. Subject: 30)  What is the motif-talk mailing list?
  1573.  
  1574. Answer: The motif-talk mailing list is only for those who have purchased a
  1575. Motif source code license. You can be placed on this list by emailing to
  1576. motif-talk-request@osf.org, citing your Company name and source license
  1577. number.
  1578.  
  1579.  
  1580. -----------------------------------------------------------------------------
  1581. Subject: 31)  What MIT patches do I use, and when do I use fix-osf?
  1582.  
  1583. Answer: The Motif 1.1.0 tape contains MIT patches 1-14. Apply these and any
  1584. others you can get.  If your MIT patch level only goes up to fix-16, you also
  1585. need to apply fix-osf.  Fix-osf was an emergency patch for a problem that
  1586. existed when the Motif 1.1 tape was cut, The MIT fix-17 completely superseded
  1587. osf-fix, so if you have applied fix-17 do not apply fix-osf.  The 1.1.1 tape
  1588. contains MIT fixes 15-18, as well as an OSF-developed fix that deals with a
  1589. subtle bug in the Selection mechanism of the Intrinsics.  Most people will
  1590. have fix-15 to 18 by now; if you don't have them:
  1591.  
  1592.         Back out fix-osf if you have applied it
  1593.         Apply fix-15 to 18
  1594.         Apply fix-osf-1.1.1
  1595.  
  1596. The Selection fix was submitted to MIT, who came up with a different fix.  It
  1597. will not be made into an R4 fix but should be in R5. The MIT fix was posted to
  1598. motif-talk.
  1599.  
  1600.  
  1601. -----------------------------------------------------------------------------
  1602. Subject: 32)  How does Motif work with X11R5?
  1603.  
  1604. Answer: Motif 1.1.X is only intended to be built with X11R4.  Motif 1.2.X is
  1605. for X11R5.  however, Motif 1.1.4 has been set to also work with X11R5.
  1606.  
  1607. For Motif 1.1.1, 1.1.2 and 1.1.3 you will need to compile Xlib and Xt with a
  1608. MOTIFBC flag set to YES (page 8, section 3.3 of the R5 release notes), or
  1609. you'll also have a link problem (LowerCase) and a fatal run time problem
  1610. (XContext manager).  If your applications come up with "Unknown keysym name:
  1611. osfActivate" errors, check the variable ProjectRoot. The name
  1612. /$PROJECTROOT/lib/XKeysymDB will have been wired into your Xlib.
  1613.  
  1614. In Motif 1.1.0, XtCallCallback uses NULL as the first argument instead of a
  1615. widget ID. This was ok under R4, but must be changed in the source for R5. It
  1616. was changed by OSF from Motif 1.1.1 onward.
  1617.  
  1618. Mrm won't work at all (can't link since it uses an X private variable that has
  1619. disappeared in R5).  There is an MIT patch that may fix this??
  1620.  
  1621. -----------------------------------------------------------------------------
  1622. Subject: 33)  How can I find which version of Motif I have?
  1623.  
  1624. [Last modified: October 93]
  1625.  
  1626. Answer: The macro XmVERSION gives you the version number.  The macro
  1627. XmREVISION gives you the major revision number.  The macro XmVersion combines
  1628. these e.g. a value of 1002 is Motif 1.2.
  1629.  
  1630. To find the minor revision number is not easy.  From Motif 1.1.3 onwards, try
  1631. this:
  1632.  
  1633.    'strings `which mwm` | grep OSF'.
  1634.  
  1635. to get the full version number e.g. 1.1.3.
  1636.  
  1637. In Motif 1.2, the macro XmUPDATE_LEVEL was added to give the minor revision
  1638. number.
  1639.  
  1640. + ( above also known as the patch level).  + In addition there was a macro
  1641. string added,  XmVERSION_STRING which has all + the above info in a char
  1642. string.
  1643.  
  1644. + grepping through a strings of libXm.a for OSF can also sometime give +
  1645. something useful.
  1646.  
  1647. Version X11R6 is due out in spring of 1994 (april 15?)
  1648.  
  1649. thanks to hops@x.co.uk Mike Hopkirk
  1650.  
  1651.  
  1652. -----------------------------------------------------------------------------
  1653. Subject: 34)  TOPIC: MOTIF and the WORLD WIDE WEB (WWW)
  1654.  
  1655. -----------------------------------------------------------------------------
  1656. Subject: 35)* Where's an HTML version of the Motif FAQ on World Wide Web
  1657. (WWW)?
  1658.  
  1659. [Last modified: Feb 95]
  1660.  
  1661. Answer: An automatically generated HTML version of this Motif FAQ can be found
  1662. at WWW URL:
  1663.  
  1664.     http://www.cis.ohio-state.edu/hypertext/faq/usenet/motif-faq/top.html
  1665.  
  1666. For a searchable version of the Motif FAQ and other FAQs (via WAIS), see:
  1667.  
  1668.     http://www.cs.ruu.nl/cgi-bin/faqwais
  1669.  
  1670. The WAIS search is great way to find a topic which may appear in several FAQs
  1671. (Motif, X, Xt, Widget FAQ, etc.)
  1672.  
  1673. -----------------------------------------------------------------------------
  1674. Subject: 36)* What are other interesting WWW URLs which are related to Motif?
  1675.  
  1676. [Last modified: Feb 95]
  1677.  
  1678. Answer:
  1679.  
  1680.         NOTE: Contributions and corrections appreciated.
  1681.  
  1682. Thanks to Sonja Kowalewski for several updates.
  1683.  
  1684. See http://www.x.org/
  1685. for the X Consortium welcome document (which contains links to getting X
  1686. source code, intro to the X Consortium, X Technical Conference, the public ftp
  1687. file server (ftp.x.org), and more.
  1688.  
  1689. See http://www.nads.de/EXUG/EXUG.html
  1690. for the EXUG (European X User Group) home page.
  1691.  
  1692. See http://www.osf.org:8001
  1693. for the OSF Home Page.
  1694.  
  1695. See http://www.osf.org:8001/general/members.html
  1696. for links to several OSF Sponsor and Member Web Servers.
  1697.  
  1698. See http://www.osf.org:8001/motif/list_features.html
  1699. for a "Complete list of 2.0 features".
  1700.  
  1701. See http://www.osf.org:8001/membserv/
  1702. OSF End User Forum and OSF Member Services.
  1703.  
  1704. See http://www.osf.org:8001/motif/MotifFAQ.html
  1705. for "OSF ANSWERS FREQUENTLY-ASKED OSF/MOTIF(R) QUESTIONS", including OSF/Motif
  1706. Release 2.0 Questions, OSF/Motif Licensing. and OSF/Motif and the Common
  1707. Desktop Environment.
  1708.  
  1709. See http://riwww.osf.org:8001/ri-home.html
  1710. for the OSF Research Institute home page.
  1711.  
  1712. See http://nearnet.gnn.com/gnn/bus/ora/index.html
  1713. for O'Reilly & Associates, Inc.
  1714.  
  1715. See http://freedom.lm.com/freedom.html
  1716. for Freedom Software ("Everything under the Sun regarding Motif").
  1717.  
  1718. See http://freedom.lm.com/review.html
  1719. for Freedom Software's page with links to a review of Motif builders, list of
  1720. Motif interface builders, commerical widgets, etc.
  1721.  
  1722. See http://tommy.informatik.uni-dortmund.de/EXUG/FAQ.html
  1723. for X11 related FAQs (X, Xt, Motif, Free widgets, OPEN LOOK, InterView,
  1724. Fresco, etc.).
  1725.  
  1726. See file://134.130.161.30/arc/pub/unix/html/motifcorner.html
  1727. for Harry's Motif Programming Corner (tips and tricks, including code).
  1728.  
  1729. See http://www.wri.com/~cwikla/widget.html
  1730. for John L. Cwikla's Widget FAQ Home Page (Composite Widgets, Non-Composite
  1731. Widgets, Motif 1.1 Compatible, Motif 1.2 Compatible, Athena Compatible, FWF
  1732. Widget Set, By Author, Shareware Widgets, Commercial Widgets).
  1733.  
  1734. See http://www.cs.cmu.edu:8001/afs/cs.cmu.edu/user/bam/www/toolnames.html
  1735. for Brad A. Myers' `User Interface Software Tools' list (which is not limited
  1736. to Motif tools).
  1737.  
  1738. See http://www.eit.com/software/winterp/winterp.html
  1739. for WINTERP 2.0 Home Page (Niels Mayer).
  1740.  
  1741. See http://www.ics.com/
  1742. for information about products sold by Integrated Computer Solutions.
  1743. Included are product descriptions and lots of Frequently Asked questions (and
  1744. answers!).
  1745.  
  1746. See
  1747. http://akebono.stanford.edu/yahoo/Computers/Operating_Systems/Windowing_Systems/X_Window_System/Motif/
  1748. for a collection of links to Motif info (including some of the above).
  1749.  
  1750. See http://www.cm.cf.ac.uk/Dave/X_lecture/X_lecture.html
  1751. for David Marshall's Motif tutorial with source code and illustrations.
  1752.  
  1753. See http://www.aiai.ed.ac.uk/~jacs/wxwin.html
  1754. for wxWindows information (toolkit for platform-independent GUI programming in
  1755. C++).
  1756.  
  1757. -----------------------------------------------------------------------------
  1758. Subject: 37)  Where can I get the HTML widget used in Mosaic?
  1759.  
  1760. [Last modified: Oct 94]
  1761.  
  1762. Answer:
  1763.  
  1764. From Ken Sall (ksall@cen.com): The HTML (HyperText Markup Language) widget is
  1765. part of the NCSA Mosaic source code, located in the directory: Mosaic/Mosaic-
  1766. source at ftp.ncsa.uiuc.edu (URL: ftp://ftp.ncsa.uiuc.edu/Mosaic/Mosaic-
  1767. source/ )
  1768.  
  1769. For example, one version is: Mosaic-2.4.tar.gz.  When you uncompress (gunzip)
  1770. and untar the source, look in the directory libhtmlw for HTML.c, HTML.h,
  1771. HTMLP.h, etc.
  1772.  
  1773. For documentation, see
  1774. http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/htmlwidget.html .
  1775.  
  1776.  
  1777. For information on using Mosaic by remote control, see
  1778. http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/remote-control.html
  1779.  
  1780. Here are more details from ah627@FreeNet.Carleton.CA (Samuel Effah):
  1781.  
  1782. To the numerous request for the NCSA HTML widget information.
  1783.  
  1784. Everything not already copyrighted by CERN is copyrighted by NCSA (including
  1785. the contents of the libhtmlw, libnet, libXmx, and src directories, but not
  1786. including the contents of libdtm, which is entirely public domain). ...
  1787.  
  1788.  * The UI grants you (hereafter, Licensee) a license to use the Software    *
  1789.  * for academic, research and internal business purposes only, without a    *
  1790.  * fee.  Licensee may distribute the binary and source code (if released)   *
  1791.  * to third parties provided that the copyright notice and this statement   *
  1792.  * appears on all copies and that no charge is associated with such         *
  1793.  * copies.                                                                  *
  1794.  *                                                                          *
  1795. ( you can read more about the copyright in the Mosaic source code ).
  1796.  
  1797.  
  1798. Documentation on the HTML widget can be located at:
  1799.  
  1800.   http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs/htmlwidget.html
  1801.   ( it's on the older version, I think Mosaic1.x )
  1802.  
  1803. For starters, you can compile directory Mosaic2.4/libhtmlw for the widget.
  1804. Using: To create widget:
  1805.   htlmWid = XtCreateManagedWidget( "htlmWid",
  1806. htmlWidgetClass,                                      parent,
  1807.                                      htlmArgs,
  1808.                                      XtNumber( htlmArgs ));
  1809.  
  1810. Callback for anchors:
  1811.   XtAddCallback(htlmWid, WbNanchorCallback, htmlRef, NULL);
  1812.  
  1813. where htmlRef() looks like:
  1814.  
  1815. static void htmlRef(widget, client_data, call_data) Widget widget; XtPointer
  1816. client_data; WbAnchorCallbackData* call_data; {
  1817.         buffer = readHTMLFile( call_data->href );
  1818.         XtVaSetValues( widget, WbNtext, buffer, NULL ); }
  1819.  
  1820. where readHTMLFile() is
  1821.  
  1822. char * readHTMLFile( in_file ) char *in_flie; {
  1823.   /* function to read a file and return its content, given
  1824.      the file's name */ }
  1825.  
  1826.  
  1827. I think this is enough to start you off.
  1828.  
  1829. Thanks to: Samuel Effah
  1830.  
  1831. -----------------------------------------------------------------------------
  1832. Subject: 38)  TOPIC: BOOKS and JOURNALS
  1833.  
  1834. -----------------------------------------------------------------------------
  1835. Subject: 39)  Is there a bibliography available?
  1836.  
  1837. [Last modified: Sept 94]
  1838.  
  1839. Answer: The X Bibliography, originally maintained by Ken Lee, is now
  1840. maintained by Steve Mikes, uunet.uu.net!topgun!smikes.  Steve regularly posts
  1841. to comp.windows.x and ba.windows.x a list of reference books and articles on X
  1842. and X programming.  The X FAQ from comp.windows.x reproduces part of this
  1843. list. The complete X bibliography is available via ftp from:
  1844.  
  1845.  
  1846.         ftp.x.org:/contrib/docs/Xbibliography.ps
  1847.         gatekeeper.dec.com:/pub/X11/R5-contrib/Xbibliography
  1848.  
  1849. -----------------------------------------------------------------------------
  1850. Subject: 40)  Is there a Motif tutorial?
  1851.  
  1852. [Last modified: Oct 94]
  1853.  
  1854. Answer: See http://www.cm.cf.ac.uk/Dave/X_lecture/X_lecture.html
  1855. for a hypertext Motif tutorial (by David Marshall) with source code and
  1856. illustrations.
  1857.  
  1858. Marshall Brain at brain@adm.csc.ncsu.edu posted a set of simple and useful
  1859. Motif tutorials.
  1860.  
  1861. Jan Borchers <job@ira.uka.de> writes about his Xmtutor:
  1862.  
  1863. A free version of "Xmtutor", a menu-driven Motif application that contains an
  1864. interactive tutorial about programming with Motif with many executable
  1865. examples, is available via anonymous ftp from ftp.uni-stuttgart.de, in:
  1866. /pub/X11/programming/xmtutor-1.2/.
  1867.  
  1868. Xmtutor is very useful to learn Motif easier than with a book, and it is a
  1869. convenient Quick Reference and resource-settings testbed for Motif application
  1870. developers.
  1871.  
  1872. It has been tested on SUN Sparcs (SunOS 4.1) and DEC Alphas (OSF/1 1.3a), but
  1873. should be working OK on most other Unix / X11R4/R5 / Motif 1.1/1.2 systems.
  1874.  
  1875. The demo version contains all the information to get you started with Motif,
  1876. and upon registration, which costs 49 DM, you get the complete tutorial,
  1877. describing all widgets, other topics such as inter-client communication,
  1878. Compound Strings, etc., as well as a formatted TeX file of the tutorial to
  1879. print out, which gives you a complete book about Motif.
  1880.  
  1881. -----------------------------------------------------------------------------
  1882. Subject: 41)* What books are available for Motif programmers?
  1883.  
  1884. [Last modified: Feb 95]
  1885.  
  1886. Answer:
  1887.  
  1888.         NOTE: This answer is always "under construction". If you are the
  1889.         author of, or an avid fan of, a book not listed here, send mail
  1890.         to ksall@cen.com.  Corrections especially regarding new editions
  1891.         and ISBN's would be greatly appreciated. Anyone have info on
  1892.         the Motif 2.0 editions of the Prentice-Hall books?
  1893.  
  1894.  
  1895. For Motif 2.0, see also the subject "Where can I find Motif 2.0
  1896. documentation?".
  1897.  
  1898. First, we present the official books from OSF. Then we include an alphabetical
  1899. listing of selected books. (See the following question for Xt and Xlib books.)
  1900.  
  1901.  
  1902. The "official" OSF/Motif books are:
  1903.  
  1904. OSF/Motif Programmers Guide, Prentice-Hall ISBN 13-640525-8 (Motif 1.0), ISBN
  1905. 0-13-640681-5 (Motif 1.1), ISBN 0-13-643107-0 (Motif 1.2) (NB: This makes use
  1906. of the demo programs that you get with a Motif source license.  The programs
  1907. are not included and may or may not be available on your system.)
  1908.  
  1909. OSF/Motif Programmers Reference Manual, Prentice-Hall ISBN 13-640517-17 (Motif
  1910. 1.0), ISBN 0-13-640616-5 (Motif 1.1), ISBN 0-13-643115-1 (Motif 1.2) You will
  1911. need this for the system calls.
  1912.  
  1913. OSF/Motif Style Guide, Prentice-Hall 13-640491-X (Motif 1.0), ISBN 0-13-
  1914. 640673-4 (Motif 1.1), ISBN 13-643123-2 (Motif 1.2) You will need this to get
  1915. some idea of how to write programs with the correct `look and feel'.
  1916.  
  1917.  
  1918. Next is an alphabetical listing (by author) of a number of essential books not
  1919. by OSF but in wide use. I will attempt to keep this list current if the
  1920. authors (or their readers) send me updates as new editions become available.
  1921.  
  1922. Barkakati, Nabajyoti, X Window System Programming, SAMS. ISBN 0-672-22750-9.
  1923. This contains a section on Motif.
  1924.  
  1925. Berlage, Thomas Berlage, OSF/Motif: Concepts and Programming, Addison-Wesley,
  1926. UK, 1991. ISBN 0-201-55792-4.
  1927.  
  1928. Ferguson, Paula & Brennan, David, Motif Reference Manual, Volume 6B, O'Reilly
  1929. & Associates, 1st Edition June 1993, 920 pages, ISBN: 1-56592-038-4.  "Dan
  1930. Heller's Motif Programming Manual [Volume 6A, below] has long been considered
  1931. the most authoritative and insightful work on Motif. Now, with the addition of
  1932. this companion reference manual, programmers can dispense completely with the
  1933. original OSF documentation. In addition to covering the entire Motif toolkit,
  1934. this book also covers OSF's "User Interface Language" or UIL, and the Motif
  1935. Resource Manager (MRM) functions used to tie together applications with user
  1936. interfaces defined in UIL."
  1937.  
  1938. Flanagan, David, Motif Tools: Streamlined GUI Design and Programming with the
  1939. Xmt Library, O'Reilly & Associates, 1st Edition August 1994, 1024 pages, ISBN:
  1940. 1-56592-044-9.  "Motif Tools and the Xmt programming library that accompanies
  1941. it on CD-ROM offer resources to empower Motif programmers and dramatically
  1942. speed up application development with the X Toolkit and Motif.  The Xmt
  1943. library contains nine custom widgets and over 250 convenience routines that
  1944. handle many tricky aspects of GUI programming. The Layout widget, for example,
  1945. is an incredibly flexible manager widget that makes the confusing and awkward
  1946. Motif Form widget a thing of the past. And a single Menu widget will create an
  1947. entire pulldown menu system for your application by reading a special menu
  1948. description from a resource file or your C code. Other features of the library
  1949. dramatically simplify the use of Motif XmStrings, automate the transfer of
  1950. data between the fields of an application's data structures and the widgets of
  1951. its dialog boxes, and make it possible to automatically create a widget
  1952. hierarchy completely described in a resource file."
  1953.  
  1954. Heller, Dan, Ferguson, Paula M. & Brennan, David, Motif Programming Manual,
  1955. Volume 6A, O'Reilly & Associates, 2nd Edition February 1994, ISBN: 1-56592-
  1956. 016-3.  "The Motif Programming Manual describes how to write applications
  1957. using the Motif toolkit from the Open Software Foundation (OSF). The book goes
  1958. into detail on every Motif widget class, with useful examples that will help
  1959. programmers to develop their own code. Anyone doing Motif programming who
  1960. doesn't want to have to figure it out on their own needs this book." Although
  1961. updated for Motif 1.2, it is still usable with Motif 1.1.
  1962.  
  1963. Johnson, Eric F. and Kevin Reichard, Power Programming Motif, second edition,
  1964. MIS: Press, New York, NY, 1993. ISBN 1-55828-322-6.
  1965.  
  1966. Johnson, Eric F. and Kevin Reichard, Professional Graphics Programming in the
  1967. X Window System, MIS: Press, New York, NY, 1993. ISBN 1-55828-255-6.  This
  1968. book covers difficult topics such as combining non-default visuals and color
  1969. overlay planes with Motif applications.
  1970.  
  1971. Newmarch, Jan, The X Window System and Motif - A Fast Track Approach.
  1972. Addison-Wesley, ISBN 0-201-53931-4.  As the long-time maintainer of this Motif
  1973. FAQ, Jan's book is bound to contain unusual and useful insights.
  1974.  
  1975. O'Reilly and Associates publishes an entire series of books concerning
  1976. different aspects of the X Window System, including a number of books about
  1977. Motif, as well as books on Xlib, Xt, and PEX. In this FAQ, we list O'Reilly
  1978. books by the authors' names. For a summary of all of O'Reilly's X11 series,
  1979. see:
  1980.  
  1981.     ftp://ftp.x.org/contrib/docs/Xbibliography.OReilly
  1982.  
  1983. As of this writing, however, the above list was somewhat out-dated.
  1984. Therefore, telnet to gopher.ora.com, login as "gopher", select "Detailed
  1985. Product Descriptions", and then select from the menu. WWW users can open this
  1986. URL:
  1987.  
  1988.     gopher://gopher.ora.com/11/descriptions/
  1989.  
  1990. Sebern, Mark "Building OSF/Motif Applications: A Practical Introduction". The
  1991. ISBN is 0-13-122409-3. Prentice-Hall. The book uses a large, realistic Motif
  1992. application (a program to make slides for presentations) to demonstrate the
  1993. use of Motif features. Both UIL and toolkit calls are discussed, though UIL is
  1994. featured, both in the examples and in a reference chapter.
  1995.  
  1996. Smith, Jerry, Designing X Clients with Xt/Motif, ISBN 1-55860-255-0 Morgan
  1997. Kaufmann Publishers This adopts a higher-level approach to many of the objects
  1998. that commonly occur in Motif but are not in the Motif API.
  1999.  
  2000. Young, Douglas, "Object-Oriented Programming with C++ and OSF/Motif", Prentice
  2001. Hall, 1992. ISBN 0-13-630252-1. Source code is
  2002. ftp://ftp.x.org/contrib/book_examples/young.cxx.tar.Z
  2003.  
  2004. Young, Douglas, "The X Window System: Programming and Applications with Xt,
  2005. Motif Edition", Prentice Hall, 1994. ISBN 0-13-123803-5. This is the classic
  2006. tutorial from 1989 updated for Motif 1.2.  Source code is
  2007. ftp://ftp.x.org/contrib/book_examples/young2.motif.tar.Z
  2008.  
  2009. Young, Douglas, "Motif Debugging and Performance Tuning", Prentice Hall, 1995.
  2010. ISBN 0-13-147984-9. Source code is
  2011. ftp://ftp.x.org/contrib/book_examples/young.debug.tar.Z
  2012.  
  2013. If you want to learn about UIL, one source is the "Motif Programmers's Guide"
  2014. from Prentice-Hall.  However, excellent UIL coverage appears in the O'Reilly
  2015. and Associates books "Motif Programming Manual, Volume 6A" by Dan Heller and
  2016. Paula M. Ferguson and in "Motif Reference Manual, Volume 6B" by Paula M.
  2017. Perguson with UIL Material by David Brennan. (Yes, 6A and 6B were worth the
  2018. wait!)
  2019.  
  2020. -----------------------------------------------------------------------------
  2021. Subject: 42)* Which Xt and X books would also be helpful?
  2022.  
  2023. [Last modified: Feb 95]
  2024.  
  2025. Answer: You will also need books and references on Xt and Xlib, such as:
  2026.  
  2027. Asente, Paul J., and Swick, Ralph R., X Window System Toolkit, The Complete
  2028. Programmer's Guide and Specification, Digital Press, 1990.  The Xt bible. A
  2029. treasury of information, excellent and invaluable.  Distributed by Digital
  2030. Press, ISBN 1-55558-051-3, Digital Press order number EY-E757E-DP; and by
  2031. Prentice-Hall, ISBN 0-13-972191-6.
  2032.  
  2033. Cutler, Ellie, Gilly Daniel, and O'Reilly, Tim, The X Window System in a
  2034. Nutshell, O'Reilly & Associates, 2nd Edition April 1992, 424 pages, ISBN: 1-
  2035. 56592-017-1.  A quick reference guide to Xlib functions datatypes and events,
  2036. Xt functions and datatypes, and the standard X clients.  The second edition is
  2037. expanded and covers X11R4 and X11R5.
  2038.  
  2039. Flanagan, David, Programmer's Supplement for R5 of the X Window System,
  2040. O'Reilly & Associates, 1991, ISBN: 0-937175-86-2.  A programmer's guide to all
  2041. the new features in X11R5, with reference pages for the new functions.
  2042. [NOTE: Out-of-print; material incorporated in recent editions of Volumes 1, 2,
  2043. 4 and 5. X11R6 supplement is in the works.]
  2044.  
  2045. Flanagan, David, Editor, X Toolkit Intrinsics Reference Manual, Volume 5,
  2046. O'Reilly & Associates, 3rd Edition April 1992, 916 pages, ISBN: 1-56592-007-4.
  2047. "The X Toolkit Intrinsics Reference Manual is a complete programmer's
  2048. reference for the X Toolkit. It provides reference pages for each of the Xt
  2049. functions as well as the widget classes defined by Xt and the Athena widgets.
  2050. This volume is based on Xt documentation from the X Consortium and has been
  2051. re-edited, reorganized, and expanded...  The third edition of Volume 5 has
  2052. been completely revised. In addition to covering Release 4 and Release 5 of X,
  2053. all the man pages have been completely rewritten for clarity and ease of use,
  2054. and new examples and descriptions have been added throughout the book."
  2055.  
  2056. Mui, Linda and Pearce, Eric, X Window System Administrator's Guide, Volume 8,
  2057. O'Reilly & Associates, 1st Edition October 1992, CD-ROM Released May 1993,
  2058. ISBN: 1-56592-052-X (with CD-ROM) "This book is the first and only book
  2059. devoted to the issues of system administration for X and X-based networks,
  2060. written not just for UNIX system administrators but for anyone faced with the
  2061. job of administering X (including those running X on stand-alone
  2062. workstations)..." A book for X system administrators, covering XDM, security,
  2063. font management, X terminals, building X, etc.  Available with a CD-ROM
  2064. containing the complete X source code.
  2065.  
  2066. Nye, Adrian, Xlib Programming Manual, Volume 1, O'Reilly and Associates, 3rd
  2067. Edition July 1992,  824 pages, ISBN: 1-56592-002-3.  "Updated to cover X11
  2068. Release 5, the Xlib Programming Manual is a complete guide to programming the
  2069. X library (Xlib), the lowest level of programming interface to X. It includes
  2070. introductions to internationalization, device-independent color, font service,
  2071. and scalable fonts. Includes chapters on: X Window System concepts, A simple
  2072. client application, Window attributes, The graphics context, Graphics in
  2073. practice, Color, Events, Interclient communication, Internationalization, The
  2074. Resource Manager, A complete client application, Window management, and Other
  2075. programming techniques."
  2076.  
  2077. Nye, Adrian, Editor, Xlib Reference Manual, Volume 2, O'Reilly & Associates,
  2078. 3rd Edition June 1992, ISBN 1-56592-006-6.  Contains reference pages, derived
  2079.  
  2080.  
  2081. from the MIT specification, for all Xlib functions.  The third edition covers
  2082. X11R4 and X11R5, including all the new internationalization and Xcms (Color
  2083. Management System) functions.
  2084.  
  2085. Nye, Adrian & O'Reilly, Tim, X Toolkit Intrinsics Programming Manual, Motif
  2086. Edition, Volume 4M, O'Reilly and Associates, 2nd Edition August 1992, 674
  2087. pages, ISBN: 1-56592-013-9.  "Volume 4 is a complete guide to programming with
  2088. the X Toolkit Intrinsics, the library of C language routines that facilitates
  2089. the design of user interfaces with reusable components called widgets.  It
  2090. provides concepts and examples that show how to use the various X Toolkit
  2091. routines. The first few chapters are devoted to using widgets; the remainder
  2092. of the book covers the more complex task of writing new widgets.  Volume 4 is
  2093. available in two editions. The Motif Edition uses the Motif 1.2 widget set in
  2094. examples, and covers X11 Release 5."
  2095.  
  2096. Quercia, Valerie & O'Reilly, Tim, X Window System User's Guide, Motif Edition,
  2097. Volume 3M, O'Reilly and Associates, 2nd Edition January 1993, 956 pages, ISBN:
  2098. 1-56592-015-5.  "The X Window System User's Guide, Motif Edition orients the
  2099. new user to window system concepts and provides detailed tutorials for many
  2100. client programs, including the xterm terminal emulator and the window manager.
  2101. Building on this basic knowledge, later chapters explain how to customize the
  2102. X environment and provide sample configurations.  This alternative edition of
  2103. the User's Guide highlights the Motif window manager, for users of the Motif
  2104. graphical user interface.  Revised for Motif 1.2 and X11 Release 5."
  2105.  
  2106. Scheifler, Robert W., and Gettys, James, X Window System, The Complete
  2107. Reference to Xlib, X Protocl, ICCCM, XLFD. Digital Press, 1992. The Xlib
  2108. bible.  Third edition covers X11R5. ISBN 1-55558-088-2, Digital Press order
  2109. number EY-J802E-DP.
  2110.  
  2111. For those interested in PHIGS and PEXlib, O'Reilly & Associates also publishes
  2112. several books on these topics. See:
  2113.  
  2114.     gopher://gopher.ora.com/11/descriptions/prox
  2115.  
  2116. -----------------------------------------------------------------------------
  2117. Subject: 43)+ Are there books for X11R6 yet?
  2118.  
  2119. [Last modified: Feb 95]
  2120.  
  2121. Answer: Check the X FAQ at:
  2122.  
  2123.     ftp://ftp.x.org/contrib/faqs/FAQ or
  2124.     http://www.cis.ohio-state.edu/hypertext/faq/usenet/x-faq/top.html
  2125.  
  2126. Also O'Reilly and Associates have a mini-FAQ regarding their plans for X11
  2127. Release 6 books:
  2128.  
  2129.     http://nearnet.gnn.com/gnn/bus/ora/news/r6.html
  2130.  
  2131. -----------------------------------------------------------------------------
  2132. Subject: 44)* What relevant journals are available?
  2133.  
  2134. [Last modified: Feb 95]
  2135.  
  2136. Answer:
  2137.  
  2138. "The X Journal" is published bimonthly by SIGS Publications, 212-274-0640.
  2139. Editorial information: editors%topgun@uunet.uu.net, editors@unx.com.
  2140.  
  2141. "The X Resource: A Practical Journal of the X Window System" is published
  2142. quarterly by O'Reilly and Associates, 800-998-9938.  Editorial information:
  2143. Paula Ferguson (paula@ora.com).  In addition to the valuable articles which
  2144. appear in regular issues, the January issue of each year (issues 1, 5, 9, 13,
  2145. etc.) contains the proceedings of the Annual X Technical Conference (from
  2146. 1992, 1993, 1994, and 1995, respectively) sponsored by the X Consortium.  An
  2147. on-line Table of Contents per issue can be accessed via gopher.  Telnet to
  2148. gopher.ora.com, login as "gopher", select "Detailed Product Descriptions", and
  2149. then "X Resource". Alternatively, the WWW URL is:
  2150.  
  2151.     gopher://gopher.ora.com/11/descriptions/xres
  2152.  
  2153. Source code examples published in "The X Resource" appear organized by issue
  2154. in the directory:
  2155.  
  2156.     ftp://ftp.ora.com/pub/examples/xresource/
  2157.  
  2158. See the index file:
  2159.  
  2160.     ftp://ftp.ora.com/pub/examples/xresource/Index
  2161.  
  2162.  
  2163. -----------------------------------------------------------------------------
  2164. Subject: 45)  TOPIC: MWM
  2165.  
  2166. -----------------------------------------------------------------------------
  2167. Subject: 46)  What is the difference between Motif and mwm?
  2168.  
  2169. Answer: mwm is a window manager. Motif itself is made up of four parts: a
  2170. User-Interface Guideline, an API toolkit of `C' routines which helps in the
  2171. building of applications which conform to the Guideline, the window manager
  2172. mwm, and a language UIL which is designed to ease user interface development.
  2173. In general mwm will run an application built with any X-windows API, and in
  2174. general an application built using the Motif toolkit will run under any window
  2175. manager.
  2176.  
  2177.  
  2178. -----------------------------------------------------------------------------
  2179. Subject: 47)  Does anyone have an alternative set of 3-D defaults for a
  2180. monochrome screen?
  2181.  
  2182. Answer: This is obviously a matter of taste. Some alternatives suggested
  2183. include
  2184.  
  2185. !Benjamin Schreiber, bs@osf.osf.org, bs@cs.brandeis.edu
  2186. Mwm*foreground:                 black           ! Actually, when a window is
  2187. Mwm*background:                 white           ! deactivated, the background
  2188. Mwm*backgroundPixmap:           50_foreground   ! becomes white, insted of
  2189. Mwm*topShadowPixmap:            white           ! 50% foreground (grey)
  2190.  
  2191. Mwm*activeForeground:           black
  2192. Mwm*activeBackground:           white
  2193. Mwm*activeBackgroundPixmap:     50_foreground
  2194. Mwm*activeTopShadowPixmap:      white
  2195.  
  2196. Mwm*menu*backgroundPixmap:      background
  2197. Mwm*menu*topShadowPixmap:       50_foreground
  2198.  
  2199. Mwm*title*foreground:                   black
  2200. Mwm*title*background:                   white
  2201. Mwm*title*backgroundPixmap:             white
  2202. Mwm*title*topShadowPixmap:              50_foreground
  2203. Mwm*title*activeForeground:             white
  2204. Mwm*title*activeBackground:             black
  2205. Mwm*title*activeBackgroundPixmap:       black
  2206. Mwm*title*activeBottomShadowPixmap:     50_foreground
  2207.  
  2208. Mwm*feedback*backgroundPixmap:          white
  2209.  
  2210. or
  2211.  
  2212. ! From: tsang@isi.com (Kam C. Tsang)
  2213. Mwm*background:                      White
  2214. Mwm*activeBackground:                White
  2215. Mwm*activeBackgroundPixmap:          25_foreground
  2216. Mwm*foreground:                      Black
  2217. Mwm*activeForeground:                Black
  2218. Mwm*menu*background:                 white
  2219. Mwm*menu*foreground:                 black
  2220. xterm*Foreground:                    black
  2221. xterm*Background:                    white
  2222.  
  2223.  
  2224. or
  2225.  
  2226. ! From: ucsd.edu!usc!snorkelwacker!paperboy!yee  (Michael K. Yee)
  2227. Mwm*cleanText:                          True
  2228.  
  2229. Mwm*activeBackground:           white
  2230. Mwm*activeForeground:           black
  2231. Mwm*background:                 white
  2232. Mwm*foreground:                 black
  2233.  
  2234. Mwm*client*activeBackgroundPixmap:      50_foreground
  2235. Mwm*client*activeTopShadowPixmap:       foreground
  2236. Mwm*client*activeBottomShadowPixmap:    background
  2237.  
  2238. !Mwm*client*background:                 white
  2239. !Mwm*client*foreground:                 black
  2240. Mwm*client*backgroundPixmap:            75_foreground
  2241. Mwm*client*topShadowPixmap:             foreground
  2242. Mwm*client*bottomShadowPixmap:          background
  2243.  
  2244. !Mwm*feedback*background:               white
  2245. !Mwm*feedback*foreground:               black
  2246. Mwm*feedback*backgroundPixmap:          50_foreground
  2247. !Mwm*feedback*topShadowPixmap:          25_foreground
  2248. !Mwm*feedback*bottomShadowPixmap:       background
  2249.  
  2250. !Mwm*menu*background:                   white
  2251. !Mwm*menu*foreground:                   black
  2252. Mwm*menu*backgroundPixmap:              foreground
  2253. !Mwm*menu*topShadowPixmap:              foreground
  2254. !Mwm*menu*bottomShadowPixmap:           background
  2255.  
  2256. !Mwm*icon*background:                   white
  2257. !Mwm*icon*foreground:                   black
  2258. Mwm*icon*activeBackgroundPixmap:        50_foreground
  2259. Mwm*icon*activeBottomShadowPixmap:      foreground
  2260. Mwm*icon*backgroundPixmap:              75_foreground
  2261.  
  2262.  
  2263. -----------------------------------------------------------------------------
  2264. Subject: 48)  How can I modify the Motif window manager decorations?
  2265.  
  2266. Answer: In resource files, use the window manager's client resource (which is
  2267. the application) and the resource clientDecoration:
  2268.  
  2269. Mwm*XClock.clientDecoration:   none
  2270.  
  2271. turns off all clock decorations.  See the mwm(1) entry for other
  2272. possibilities.
  2273.  
  2274. Programmatically, set the VendorShell resource XmNmwmDecorations to
  2275. appropriate values: MWM_DECOR_NONE (or a bitwise or of values).
  2276.  
  2277. -----------------------------------------------------------------------------
  2278. Subject: 49)  Is there an ICCCM compliant way of setting window manager
  2279. decorations?
  2280.  
  2281. Answer: Tom LaStrange (toml@LaStrange.COM) writes: "No, there is no ICCCM
  2282. portable way to alter decorations." ----------
  2283. -------------------------------------------------------------------
  2284. Subject: 50)  How can I turn off the Motif window manager functions from the
  2285. system menu?
  2286. [Last modified: October 92]
  2287.  
  2288. Answer: The user of an application can control functions in the system menu
  2289. for an application using the mwm resource clientFunctions:
  2290.  
  2291.         mwm.application_name.clientFunctions: -resize -close
  2292.  
  2293. Note that mwm will have to be restarted after putting this in their resource
  2294. database.
  2295.  
  2296.  
  2297. Answer: The writer of an application can only remove items.  Be warned that
  2298. your users will probably gnash their teeth, swear furiously at your product
  2299. and stop using it if they discover that you have done this.  (Especially if
  2300. you have removed the Close button, your application has hung and it has taken
  2301. up all of memory and swap so it can't be killed.) Much better is to catch the
  2302. action gracefully as in the next question.
  2303.  
  2304.         #include <Xm/MwmUtil.h>
  2305.  
  2306.         XtVaGetValues(shell, XmNmwmFunctions, &int_val, NULL);
  2307.         int_val &= ~(MWM_FUNC_CLOSE | MWM_FUNC_ALL);
  2308.         XtVaSetValues(shell, XmNmwmFunctions, int_val, NULL);
  2309.  
  2310.  
  2311. -----------------------------------------------------------------------------
  2312. Subject: 51)+ How can my application know when the user has quit Mwm?
  2313.  
  2314. [Last modified: Feb 95]
  2315.  
  2316. Answer: Looking for an answer to this one. ANY TAKERS?
  2317.  
  2318. -----------------------------------------------------------------------------
  2319. Subject: 52)* How can I tell if the user has selected the "Close" choice from
  2320. the system menu attached to the top-level shell?  I need to do some clean up
  2321. before exiting.
  2322.  
  2323. [Last modified: Feb 95]
  2324.  
  2325. Answer:          This works with R4 Intrinsics
  2326.  
  2327.         #include <Xm/Protocols.h>
  2328.  
  2329.         void FinalCleanupCB(w, client_data, call_data)
  2330.         Widget   w;
  2331.         caddr_t  client_data, call_data;
  2332.         {
  2333.                 /* tidy up stuff here */
  2334.                 ...
  2335.                 /* exit if you want to */
  2336.                 exit (0);
  2337.         }
  2338.  
  2339.         main()
  2340.         {
  2341.                 Atom wm_delete_window;
  2342.  
  2343.                 ...
  2344.                 XtRealizeWidget(toplevel);
  2345.                 ...
  2346.                 wm_delete_window =
  2347.                         XmInternAtom(XtDisplay(toplevel),
  2348.                                 "WM_DELETE_WINDOW", False);
  2349.                 XmAddWMProtocolCallback(toplevel, wm_delete_window,
  2350.                         FinalCleanupCB, NULL);
  2351.                 XtMainLoop();
  2352.         }
  2353.  
  2354. This will still kill the application.  To turn this behaviour off so that the
  2355. application is not killed, set the shell resource XmNdeleteResponse to
  2356. XmDO_NOTHING.  This means that users cannot kill your application via the
  2357. system menu, and may be a bad thing.
  2358.  
  2359. If you are running R3, Bob Hays (bobhays@spss.com) has suggested this:
  2360. "Trapping on the delete window atom does not work as I cannot force my action
  2361. routine to the top of the action list for the activity desired, so the window
  2362. manager kills my window anyway BEFORE I can do anything about it.  And, to
  2363. make matters worse, the window manager (Motif in this case) tacks its atoms
  2364. and handlers onto the window at some unknown point down the line after the
  2365. creation of the shell widget as far as I can tell.  So....
  2366.  
  2367. I have a procedure as an action routine for ClientMessage.  Then, if I get a
  2368. property change event on the window manager protocols, I then tack on
  2369. WM_SAVE_YOURSELF.  If I get this request, I clean up (it seems to happen on
  2370. WM_DELETE_WINDOW, BTW, if you remove WM_DELETE_WINDOW from the WM protocols
  2371. atom) and exit.  Works great and is less filling overall:-)."
  2372.  
  2373. The following similar code fragment is from Dave Mink
  2374. (mink@cadcam.pms.ford.com):
  2375.  
  2376. void setupCloseCallback(Widget shell, XtCallbackProc closeProc)
  2377. {
  2378.     /* get window manager delete protocol atom */
  2379.     Atom deletewin_protocol = XmInternAtom(
  2380.         XtDisplay(shell), "WM_DELETE_WINDOW", True
  2381.         );
  2382.     /* turn off default delete response */
  2383.     XtVaSetValues( shell,
  2384.         XmNdeleteResponse, XmDO_NOTHING,
  2385.         NULL);
  2386.     /* add callback for window manager delete protocol */
  2387.     XmAddWMProtocolCallback(shell, deletewin_protocol, closeProc, NULL);
  2388. }
  2389.  
  2390.  
  2391. -----------------------------------------------------------------------------
  2392. Subject: 53)  Is there an mwm virtual desktop manager?
  2393.  
  2394. [Last modified: Nov 94]
  2395.  
  2396. Answer: David Kaelbling (drk@x.org) reports: In OSF/Motif 2.0, mwm supports
  2397. both workspaces (see the f.cci function and the wsm demo for a sample
  2398. interface) and a virtual root window.  To manipulate the virtual screen
  2399. f.goto, f.pan, and f.track_pan were added, as were iconPinned and clientPinned
  2400. client resources.
  2401.  
  2402. Peter E. Wagner (pew@cs.brown.edu): Imagine that your "desktop" extends beyond
  2403. the view provided by your monitor.  A virtual window manager gives you access
  2404. to the space beyond your viewport (i.e. your screen) by allowing you to move
  2405. the viewport to other areas of the extended desktop.
  2406.  
  2407. The first one is Solbourne's swm, which spawned vtwm/tvtwm/olvwm.
  2408.  
  2409. David B. Lewis created one.  suresh@unipalm.co.uk has further developed it
  2410. into the UniPalm product DOORS, which is only available as a source code
  2411. extension to the MOTIF window manager.  The price of the source and unlimited
  2412. right to distribute binaries is 10,000 pounds Sterling.  Alternately, source
  2413. and right to use within one company is 2,000 pounds Sterling.  Contact Peter
  2414. Dawe
  2415.  
  2416. Unipalm Limited                         Voice: +44 (0) 223 420002
  2417. 216 The Science Park                    Fax:   +44 (0) 223 426868
  2418. CAMBRIDGE
  2419. CB4 4WA
  2420.  
  2421. An enhancement request for such an object has been filed with OSF.
  2422.  
  2423. Tim Failes (tim@aus.oz.au) of Advanced User Systems Pty Ltd writes: IXI has a
  2424. fully supported product called Panorama which provides this facility.
  2425. Panorama allows the user to pan around the virtual work space, dynamically
  2426. change the size of the virtual workspace, and also access windows via an icon
  2427. box.  Panorama also includes a point-and-click tool for setting resources such
  2428. as colours, focus policy, etc. [IXI contact information appears in the "Where
  2429. can I get Motif?" subject. -ed]
  2430.  
  2431. -----------------------------------------------------------------------------
  2432. Subject: 54)  Why does mwm 1.2 crash on startup?
  2433.  
  2434. [Last modified: March 93]
  2435.  
  2436. Answer: From David Brooks: The commonest cause of early mwm demise is as
  2437. follows:
  2438.  
  2439. - You, or someone, built Xlib in the default way using the Xsi
  2440.   internationalization functions.
  2441.  
  2442. - Your Xlib wasn't installed completely (or at all).
  2443.  
  2444. - Early on, mwm calls the function XmbTextListToTextProperty, which calls
  2445.   _XConvertMBToCT, which looks for the Xsi locale database, finds it
  2446.   missing, ignores this fact and tries to dereference zero.
  2447.  
  2448. The workaround is to find the database *somewhere*, and point the environment
  2449. variable XNLSPATH at it.  For example, in my personal X source tree:
  2450.  
  2451.         setenv XNLSPATH /home/X11r5src/mit/lib/nls/Xsi
  2452.  
  2453.  
  2454. -----------------------------------------------------------------------------
  2455. Subject: 55)  TOPIC: MOTIF DEVELOPMENT TOOLS (GUI BUILDERS and UIMS's)
  2456.  
  2457. -----------------------------------------------------------------------------
  2458. Subject: 56)  What tools exist to assist in developing Motif applications?
  2459.  
  2460. [Last modified: Oct 94]
  2461.  
  2462. Answer: [A FAQ is not for "personal opinions" on these tools.  I don't think
  2463. it is appropriate to give such opinions through this particular posting, so I
  2464. haven't included any. I will include vendor-provided descriptions provided
  2465. they are concise and informative. See Subject 0 for contribution details.]
  2466.  
  2467. `Prototyping tools' and `code generation tools' come in two forms:
  2468.  
  2469.     GUI (Graphical User Interface) builder -
  2470.     those that can be used to design (and perhaps rehearse)
  2471.     the interface only ; and
  2472.  
  2473.     UIMS (User Interface Management Systems) -
  2474.     those that are a system supporting the development and
  2475.     execution of user interfaces.
  2476.  
  2477. However, this distinction can be somewhat arbitrary when specific tools are
  2478. categorized as either one or the other.  (Therefore, the classification below
  2479. should be taken with a kilogram of salt. :-)
  2480.  
  2481. A number of commercial and non-commercial tools of both kinds that will
  2482. support Motif are listed below. [NOTE: Vendors or individuals wishing to add
  2483. their product or tool to this list, or to change their entry, should email to
  2484. the maintainer of this FAQ.]
  2485.  
  2486. GUI builders:
  2487.  
  2488.         Builder Xcessory (bx)
  2489.         Druid
  2490.         ExoCODE/xm
  2491.         iXBUILD (formerly X Build)
  2492.         MOTIFATION
  2493.         WKSH (Windowing Korn Shell)
  2494.         X-Designer
  2495.  
  2496. UIMS:
  2497.  
  2498.         ALEX
  2499.         ezX User Interface Management System
  2500.         Galaxy
  2501.         MetaCard
  2502.         Serpent
  2503.         TAE Plus
  2504.         TeleUse
  2505.         UIMX
  2506.         Widget Creation Library (Wcl)
  2507.         WINTERP
  2508.         XFaceMaker2
  2509.  
  2510.  
  2511. For users of the WWW, see also Brad A. Myers' `User Interface Software Tools'
  2512. list (which is not limited to Motif tools):
  2513. http://www.cs.cmu.edu:8001/afs/cs.cmu.edu/user/bam/www/toolnames.html
  2514.  
  2515.  
  2516. Some contact addresses, presented in alphabetical order (without regard to GUI
  2517. or UIMS categorization), follow:
  2518.  
  2519.  
  2520. o  ALEX: For more information contact Michael Karliner on (+44) 81 566 2307 or
  2521. E-mail to alex@s-strat.co.uk.  ALEX Technologies, Waterman's Yard, 32a The
  2522. Mall, Ealing, London W5, UK.
  2523.  
  2524.  
  2525. o  Builder Xcessory (bx): is from ICS.  More details are available by sending
  2526. a request to info@ics.com.  Address:
  2527.  
  2528.         ICS Inc.,
  2529.         201 Broadway,
  2530.         Cambridge MA 02139,
  2531.         Tel. (617) 621-0060,
  2532.         Fax. (617) 621-9555
  2533.         http://www.ics.com/
  2534.  
  2535.  
  2536. o  Druid: is a commercial product. It currently supports Motif1.1 and 4 unix
  2537. platforms: SPARC, HP 9000, RS6000, and SGI. For further information contact:
  2538.  
  2539.         Mr. Fred Lee,
  2540.         Automated Systems (Pte) Limited,
  2541.         203 Henderson Road, #12-07/14,
  2542.         Henderson Industrial Park,
  2543.         Singapore 0315.
  2544.         FAX: (65)272-2029
  2545.  
  2546.  
  2547. Or: Dr. Gurminder Singh (gsingh@iss.nus.sg), Institute of Systems Science,
  2548. National University of Singapore
  2549.  
  2550.  
  2551. o  ExoCODE/xm: From Expert Object Corp., 7250 Cicero Avenue, Lincolnwood, IL
  2552. 60646 (708)676-5555.  Also: ExoCODE, EXOC, 500 Hyacinth Place, Highland Park,
  2553. IL, 60035, (708) 926-8500, $1,500, Motif or OpenLook or SunView.
  2554.  
  2555.  
  2556. o  ezX: Contact information:
  2557.  
  2558.         ezX User Interface Management System
  2559.         Sunrise Software, International
  2560.         170 Enterprise Center
  2561.         Middletown, RI 02840
  2562.         401-847-7868
  2563.         email: support@sunrise.com
  2564.  
  2565.  
  2566. o  Galaxy, Visix Software Inc., 11440 Commerce Park Drive, Reston, VA, 22091,
  2567. (800) 832-8668, $9,600, Mac, Windows, Motif, OpenLook; very complete, Virtual
  2568. Toolkit, UIMS
  2569.  
  2570.  
  2571. o  iXBUILD (formerly X Build):
  2572.  
  2573.         iXOS Software GmbH,
  2574.         Bretonischer Ring 12,
  2575.         8011 Grasbrunn/Munich, Germany,
  2576.         email support@ixos.de or office@ixos.de,
  2577.         phone ++49-89-46005 0
  2578.  
  2579. or in the US:
  2580.  
  2581.         UniPress Software,
  2582.         2025 Lincoln Hwy.,
  2583.         Edison, NJ 08817,
  2584.         phone 1-800-222-0550
  2585.  
  2586.  
  2587. o  MetaCard: MetaCard 1.0 is supported on five popular UNIX/X11 platforms:
  2588. SPARC, Sun3, DECstation, HP-9000/300, and SCO ODT.  An HP-9000/700 port is
  2589. underway and should be available by the end of July.  [They] plan to support
  2590. IBM RS/6000, SGI Iris, and DG AViiON sometime fall '92.  For more information,
  2591. or to receive a free save-disabled but licensable copy of MetaCard, email to
  2592. info@metacard.com or call 303- 447-3936.  If you have anonymous FTP access to
  2593. the Internet, you can download the current engines, documentation, and an
  2594. unlicensed Home stack from ftp.metacard.com (128.138.213.21), directory
  2595. MetaCard.  Commercial users can get MetaCard from world.std.com
  2596. (192.74.137.5), directory pub/Metacard.  If you don't have an anonymous ftp
  2597. access, you can also download MetaCard from The World using kermit or xmodem
  2598. from the ~ftp/pub/MetaCard directory.  Sign up by calling 617-739-0202 (voice)
  2599. or via modem by dialing 617-739-9753 (7 bits even parity) and logging in as
  2600. new.
  2601.  
  2602. MetaCard 1.2 Beta 5 is now available for anonymous FTP from ftp.metacard.com
  2603. (directory MetaCard/1.2B5), and ftp.uu.net (directory vendor/MetaCard/1.2B5).
  2604.  
  2605. There is also a MetaCard mailing list.  To subscribe to the metacard-list,
  2606. send mail to listserv@grot.starconn.com with the following commands in the
  2607. body of the message:
  2608.  
  2609.       subscribe metacard-list firstname lastname
  2610.       quit
  2611.  
  2612. Replace "firstname lastname" with your name, not your e-mail address.
  2613.  
  2614.  
  2615. o  MOTIFATION: PEM GmbH, Vaihinger Strasse 49, 7000 Stuttgart 80, Germany,
  2616. Tel: +49 (0) 711 713045, Fax: +49 (0) 711 713047 Email: basien@pem-
  2617. stuttgart.de.  Available for (Motif 1.2/1.1) on SunOS, Solaris 2.1, HP,
  2618. Interactive, ODT 3.0, Silicon Graphics, PCS, ...
  2619.  
  2620.  
  2621. o  Serpent: The S/W is free (anonymous ftp) from ftp.sei.cmu.edu.  For more
  2622. info contact erik/robert at serpent-info@sei.cmu.edu.  NOTE: This is no longer
  2623. supported, and is apparently replaced by a commercial product called Alpha.
  2624.  
  2625.  
  2626. o  TAE Plus: TAE Plus is a mature, portable software development environment
  2627. that supports rapid prototyping, tailoring, and management of Motif-based
  2628. graphical user interfaces.  It particularly supports GUI development by non-
  2629. programmers and by programmers who are not well-versed in the details of X and
  2630. Motif.  Its code generator can produce C, C++, and Ada code and allows for
  2631. automatic merging of regenerated code with previously modified parts of the
  2632. interface code.  It supports generation of a UIL/Mrm representation of the
  2633. interface.
  2634.  
  2635. Scripting capabilities are provided to facilitate automatic testing, on-line
  2636. demos, and tutorials.  A record and playback feature lets you build scripts
  2637. simply by interacting with your GUI.  Dynamic Data Objects allow the developer
  2638. to create pictorial objects (e.g., a thermometer to show temperature), whose
  2639. dynamic portions (e.g., the mercury in the themometer) can change to reflect
  2640. changing data or be directly manipulated by the end-user. TAE Plus is
  2641. available on Sun, HP, IBM, SGI, and SCO Unix platforms.  Evaluation software
  2642. is available via anonymous ftp.
  2643.  
  2644. TAE Plus contact information:
  2645.  
  2646.         Century Computing, Inc.
  2647.         1014 West Street
  2648.         Laurel, MD 20707
  2649.         1-800-823-3228
  2650.         tae-info@cen.com
  2651.  
  2652.  
  2653. o  TeleUSE: Built around X Windows and OSF/Motif, TeleUSE's comprehensive
  2654. toolset gives you maximum control over every phase of graphical user interface
  2655. development, including static screen layout and design, automatic
  2656. implementation of callbacks, building the executable, and the interactive
  2657. test, debug, and maintenance cycles.  For more information, please contact:
  2658.  
  2659. In North America and countries not specified below:
  2660.  
  2661.         Alsys (formerly TeleSoft)
  2662.         10251 Vista Sorrento Parkway Suite 300
  2663.         San Diego, CA 92121 USA
  2664.         (619) 457-2700 X244
  2665.         (619) 452-1334 (fax)
  2666.         leigh@alsys.com
  2667.  
  2668.         In France: +33 1 47 66 21 83
  2669.         In the UK: +49 491 579 090
  2670.         In Scandinavia: +46 8 520 69010
  2671.         In the Benelux: +31 15 62 21 21
  2672.         In Germany: +49 7531 65022
  2673.         In Italy: +39 6 5045 1
  2674.         In Japan: +81 3 522 85620
  2675.         In South Korea: +82 2 577 2044
  2676.  
  2677.  
  2678. o  UIMX:
  2679.  
  2680.         Visual Edge Software Limited
  2681.         3870 Cote Vertu
  2682.         St Laurent, Quebec
  2683.         H4R 1V4
  2684.         Phone: (514) 332-6430
  2685.         Fax:   (514) 332-5914
  2686. or:
  2687.         Visual Edge Software Ltd.
  2688.         101 First Street, Suite 443
  2689.         Los Altos, CA 94022
  2690.         Phone: (415) 948-0753
  2691.         Fax:   (415) 948-0843
  2692.  
  2693.  
  2694. o  Widget Creation Library (Wcl): The distribution is available in several
  2695. ways.  The preferred approach it for you to get the compressed tar file using
  2696. anonymous ftp from:
  2697.  
  2698.  
  2699.         ftp.x.org       /R5contrib/Wcl-2.5.tar.Z
  2700.         WWW URL: ftp://ftp.x.org/R5contrib/Wcl-2.5.tar.Z
  2701.  
  2702.  
  2703. o  WINTERP: (Widget INTERPreter) An object-oriented rapid prototyping,
  2704. development and delivery environment for building extensible applications with
  2705. the OSF/Motif UI Toolkit and Xtango-based graphics/animation. By Niels Mayer
  2706. (mayer@netcom.com).  Mailing list: winterp-request@netcom.com. Available via
  2707. ftp from ftp.x.org:/contrib/devel_tools/winterp-2.xx.tar.gz (where 'xx' is
  2708. currently '03').
  2709.  
  2710. Key WINTERP Features:
  2711.  
  2712.         * High-level, Object-oriented interface to OSF/Motif and Xtoolkit.
  2713.         * High-level object-oriented 2.5D graphics&animation widget based
  2714.           on Xtango path transition animation system.
  2715.         * Ability to easily create new widget classes w/ complex graphical
  2716.           behavior using Xtango animation/graphics.
  2717.         * Automatic storeage management of all X/Xt/Motif data, Pixmaps,
  2718.           animations. Automatic resource conversion and management.
  2719.         * Asynchronous communications w/ other unix programs via
  2720.           expect-based subprocess facility.
  2721.         * Includes XmGraph to display graphs (both cyclic, acyclic,
  2722.           directed, undirected); graph nodes can be arbitrary widgets
  2723.           created by WINTERP; supports direct manipulation editing of graph.
  2724.         * GIF image support.
  2725.         * Lisp-eval server architecture supports inter-application
  2726.           communication.
  2727.         * Interactive programming via Gnu-Emacs or Motif-Text-widget interface.
  2728.         * Portable, small, fast, and free.
  2729.  
  2730.  
  2731. o  WKSH (Windowing Korn Shell):
  2732.  
  2733.         EXtensible Korn Shell (C language calling interface,
  2734.         dynamic library loading, etc.)
  2735.         Motif or OpenLook API
  2736.         X Toolkit Intrinsics
  2737.         WKSH Convenience Functions
  2738.         Fast Learning and Prototyping Feature (ksh interpreter)
  2739. Contact:
  2740.         Acacia Computer,
  2741.         PO Box 4376,
  2742.         Warren, NJ 07059,
  2743.         Phone: 908 548 6955,
  2744.         Email: uunet!aca1
  2745.  
  2746.  
  2747. or: Computer Aid Inc, 1-(800)-444-WKSH, or:
  2748.  
  2749.  
  2750.         Consensys Corp,
  2751.         Europe: +(44)-734-833241 (Roger Chalke), +(44)0734-835391 (Fax),
  2752.         US: (416)-940-2903, (416)-940-2903 (Fax).
  2753.  
  2754.  
  2755. WKSH was developed by USL. Binaries are available through Acacia Computer for
  2756. SUNOS, Solaris, SCO ODT, Intel SVR4.0
  2757.  
  2758.  
  2759. o  X-Designer: From Imperial Software Technology in the UK.  Email address is
  2760. sales@ist.co.uk.  (+44) 743 587055
  2761.  
  2762. V.I. Corporation have become the distributor for the X-Designer product in the
  2763. United States.  In addition, IST and V.I. Corporation have developed a product
  2764. called DVX-Designer that merges X-Designer with their GUI product called
  2765. DataViews.  Other merged products are in the works.  For more information,
  2766. people can contact:
  2767.  
  2768.         V.I. Corporation
  2769.         47 Pleasant Street
  2770.         Northampton, MA  01060
  2771.         Phone: (413) 586-4144
  2772.         Fax: (413) 586-3805
  2773.         Email: vi@vicorp.com
  2774.  
  2775.  
  2776. o  XFaceMaker2:
  2777.  
  2778.         NSL -  Non Standard Logics S.A.,
  2779.         57-59, rue Lhomond,
  2780.         75005  Paris - France,
  2781.         Phone: +33 (1) 43.36.77.50,
  2782.         Fax:   +33 (1) 43.36.59.78
  2783.         email: requests@nsl.fr or requests%nsl.fr@inria.fr for information.
  2784.  
  2785. Their North American office:
  2786.  
  2787.         Non Standard Logics, Inc.,
  2788.         4141 State Street, Suite B-11,
  2789.         Santa Barbara CA 93110,
  2790.         Tel: 805 964 9599,
  2791.         Fax: 805 964 4367
  2792.  
  2793. -----------------------------------------------------------------------------
  2794. Subject: 57)  TOPIC: GEOMETRY MANAGEMENT
  2795.  
  2796. [NOTE: As you can see, this is a new topic area. Send me your ideas for
  2797. answered questions pertaining to this topic.]
  2798.  
  2799. -----------------------------------------------------------------------------
  2800. Subject: 58)  Why is geometry management so important?
  2801.  
  2802. [Last modified: Sept 94]
  2803.  
  2804. Answer: Geometry management is a key element of Motif applications for reasons
  2805. which include, but are not limited to, the following:
  2806.  
  2807.  
  2808.     The user should be able to re-size the shell and get
  2809.     some reasonable geometry response (other than clipping).
  2810.  
  2811.     The user should be able to tailor fonts and have the
  2812.     widgets adjust accordingly.  (Many people over 40 simply
  2813.     can't read small fonts without serious eye strain.)
  2814.  
  2815.     When the designers decide to change a label, the widgets
  2816.     should re-adjust accordingly.
  2817.  
  2818.     Some labels must be set dynamically and the widgets should
  2819.     re-layout accordingly.
  2820.  
  2821.     An internationalized application must work with several resource
  2822.     files, one for each supported natural language.  The labels in each
  2823.     file have different lengths and the application should adjust
  2824.     accordingly.
  2825.  
  2826.  
  2827. -----------------------------------------------------------------------------
  2828. Subject: 59)  What are good references for reading about geometry management?
  2829.  
  2830. [Last modified: Oct 94]
  2831.  
  2832. Answer: See the BOOKS topics for detailed reference information.  "X Toolkit
  2833. Intrinsics Programming Manual" (Nye & O'Reilly) contains an entire chapter on
  2834. geometry management, as does "X Window System Toolkit" (Asente & Swick) on
  2835. which the O'Reilly book is based.  Another good reference is the discussion of
  2836. the "geometry_manager" and "query_geometry" methods in "X Toolkit Intrinsics
  2837. Reference Manual".
  2838.  
  2839. "Motif Programming Manual" (Heller & Ferguson) has a chapter devoted to Motif
  2840. Manager widgets.  Finally, the widget documentation for each geometry manager
  2841. widget typically describes its policy in detail.
  2842.  
  2843. -----------------------------------------------------------------------------
  2844. Subject: 60)  Why don't my labels resize in a RowColumn widget?  I have a
  2845. RowColumn widget in my application, with several rows and columns of XmLabels.
  2846. When I update the text in the labels, the label's width does not get updated.
  2847.  
  2848. [Last modified: Oct 94]
  2849.  
  2850. Answer: Make sure all the ancestor widget resize mechanisms are enabled:
  2851.  
  2852.    - on shells, set XmNallowShellResize
  2853.    - on row column, set XmNresizeWidth and XmNresizeHeight
  2854.    - on bulletin board and form, set XmNresizePolicy
  2855.  
  2856. Also, set XmNrecomputeSize on the label itself.  The shell resource is off by
  2857. default; the others should be on by default.
  2858.  
  2859. Thanks to Ken Lee, kenton@esd.sgi.com
  2860.  
  2861. -----------------------------------------------------------------------------
  2862. Subject: 61)  Why do dialogs appear smaller under 1.2.3 and later?  The same
  2863. problem occurs with parts of a complex main window.  All of my dialogs which
  2864. were fine under 1.2.2 and earlier come up too small to work with under 1.2.3
  2865. (or later). Why?
  2866.  
  2867. A. Thanks to David Brooks (dbrooks@ics.com) for pointing me to Daniel
  2868. Dardailler (daniel@x.org) who wrote this scholarly treatise:
  2869.  
  2870.  
  2871.       Application's Geometry Management Advanced Guidelines:
  2872.       =====================================================
  2873.       (or "How to properly manage children of already realized parent")
  2874.  
  2875. Xt Background:
  2876. -------------
  2877.  
  2878.     XtCreateWidget:        call Initialize ;
  2879.  
  2880.     XtManageChild:         if (parent realized)
  2881.                               call ChangeManaged ;
  2882.                               call Realize ;
  2883.  
  2884.     XtRealizeWidget:       postorder ChangeManaged loop ;
  2885.                            preorder Window-creation loop ;
  2886.  
  2887.  
  2888. Creating a widget only invokes its Initialize method (its parent's
  2889. InsertPosition method too, but that has nothing to do with GM).
  2890. Composite widgets, by opposition to Primitive, does
  2891. not usually get a correct size at initialization time, since their
  2892. correct size is based on their children sizes, which do not exist yet
  2893. at this time.
  2894.  
  2895. Applications usually create an entire tree of managed but
  2896. unrealized widgets and then realize their top level widget, which recursively
  2897. realize every widgets in the tree. During the creation process, the
  2898. managing of the unrealized widgets is a no-op (only mark them managed).
  2899.  
  2900. When XtRealizeWidget(toplevel) happens, the change_managed methods of
  2901. all the composite widgets in the tree are called in bottom-to-top
  2902. order, thus giving each of them a chance to determine their own size
  2903. based on their children *current* sizes (composite or not).
  2904. Using the current size of the children in this situation is fine,
  2905. since they should also be the children's preferred size, not
  2906. yet constrained by the parents layout (post-order traversal).
  2907.  
  2908. When one create a widget inside an already realized parent, this is
  2909. a different story and the order of management vs realization is important.
  2910.  
  2911. Consider a MessageBox created in a realized Frame.
  2912. The MessageBox itself creates a bunch of managed children
  2913. inside its Initialize method.
  2914. If you manage the MessageBox right after its creation, the Frame
  2915. ChangeManaged will be called (since it is realized), and its will use
  2916. the MessageBox current size as its base for its own size.
  2917. Unfortunately, the MessageBox ChangeManaged proc has never been called!
  2918. so its current size is whatever the default is, usually a non-settable
  2919. value (needed for tracking real initial size setting).
  2920. The MessageBox ChangeManaged has not been called because its children
  2921. were created and managed at a time where it wasn't realized.
  2922.  
  2923. What to do ?
  2924.  
  2925. The first solution would be to have all the ChangeManaged methods in
  2926. Motif call XtQueryGeometry instead of using the current size if it's
  2927. not the first time (i.e. if they're already realized).
  2928. But this is a lot of code to change and a kind of expensive run-time
  2929. process as it results in non-linear traversal order of the realized
  2930. tree (looks like an O(n!) but I'm not sure).
  2931. It's not even guaranteed that it will always work fine, since it relies on
  2932. the assumption that the geometry queried is the same that the geometry
  2933. asked for any manager (I mean, it might be the case, but if it's not,
  2934. it's just more code to fix in a very "bc-sensitive" part of Xm).
  2935.  
  2936.  
  2937. This other solution lies into the application, and is to realize a
  2938. manager first and then to manage it.
  2939. By realizing it, you are forcing its ChangeManaged proc to be
  2940. called (XtRealizeWidget does that), it will get a correct size and
  2941. this size will be used by its parent ChangeManaged when
  2942. you'll manage the manager. By explicitly realizing the branch
  2943. before managing its root, you are reproducing the ordering that
  2944. is typical of most applications at startup.
  2945.  
  2946. So the trick is:
  2947.  
  2948.         XtCreateWidget(realize_parent, MessageBox);
  2949.         XtRealizeWidget(MessageBox);  /* needed */
  2950.         XtManageChild(MessageBox);
  2951.  
  2952. and the model is:
  2953.  
  2954.     "Always explicitly realize a composite widget child of an already
  2955.      realized parent before managing it if all its children have been
  2956.      already managed"
  2957.  
  2958. One can always realize every widget children of realized parents, that
  2959. won't hurt, but it's useless for Primitives and Composites that
  2960. get more children added later in the program.
  2961. Why? because Primitives get their correct size at initialization
  2962. time anyway and adding a child to a Composite will generate a geometry
  2963. request and a layout that will have the same effect as if the
  2964. ChangeManaged method had been called (well, nearly the same effect,
  2965. that a complication I will address later).
  2966.  
  2967. If we consider Motif, this trick is only useful for MessageBox,
  2968. SelectionBox and subclasses, and Scale, since those are the only
  2969. Composites that create managed children in their Initialize method and
  2970. don't usually get additional kids from the application.
  2971.  
  2972. However, any application that re-creates this order of actions will
  2973. need to apply the "realize<manage" method too.
  2974. For instance:
  2975.  
  2976.         XtCreateWidget(realize_parent, DrawingArea);
  2977.         XtRealizeWidget(DrawingArea);   /* not needed */
  2978.         XtManageChild(DrawingArea);
  2979.         XtCreateWidget(DrawingArea, any_child) ;
  2980.         XtManageChild(any_child);
  2981. but
  2982.         XtCreateWidget(realize_parent, DrawingArea);
  2983.         XtCreateWidget(DrawingArea, any_child) ;
  2984.         XtManageChild(any_child);
  2985.         XtRealizeWidget(DrawingArea);   /* needed */
  2986.         XtManageChild(DrawingArea);
  2987.  
  2988. Now this is becoming interesting: there are exceptions to the model :-)
  2989.  
  2990. The first one is the Xt Shell widget, which has what I consider to be a
  2991. bug, but what MIT has, until recently, always considered to be a specific
  2992. behavior overridable by a subclass (like our VendorShell):
  2993. the ChangeManaged method always resizes the child to its own size
  2994. when the Shell is realized.
  2995.  
  2996. A side effect of this behavior is that even the realized<managed trick
  2997. won't work for direct descendant of Shell widget:
  2998.  
  2999.         XtCreateWidget(realize_shell, MessageBox);
  3000.         XtRealizeWidget(MessageBox);  /* needless */
  3001.         XtManageChild(MessageBox);    /* will get resized anyway */
  3002.  
  3003. To get rid of this problem, one needs to add a regular manager
  3004. between the Shell and the MessageBox in this case, for the sake
  3005. of having this manager doing a request to the Shell from its
  3006. ChangeManaged proc. This request will then be handled by the Shell
  3007. geometry manager, not its ChangeManaged proc, and it will take into
  3008. account the child size.
  3009. Note that we could also change our VendorShell ChangeManaged code to not
  3010. systematically envelop the Xt Shell ChangeManaged class method, and
  3011. check for the already realized case, but I would rather wait
  3012. for an Xt fix instead (I'm working on it).
  3013.  
  3014. If you broader the scope of the Xt Shell situation, you find that there are
  3015. also some resources in Xm that come into effect upon geometry request
  3016. reception but are not used in the ChangeManaged method.
  3017.  
  3018. Take the PanedWindow constraint resource XmNallowResize for instance,
  3019. which controls the validity of a geometry request made by a PW child.
  3020.  
  3021. If you do:
  3022.  
  3023.         XtCreateWidget(realize_shell, PanedWindow);
  3024.         XtManageChild(PanedWindow);
  3025.  
  3026.         XtCreateWidget(PanedWindow, button);
  3027.         XtManageChild(button);
  3028.  
  3029. that works fine since the ChangeManaged of the PanedWindow will
  3030. handle the insertion of the button and allowResize won't be used.
  3031.  
  3032. But if you add a manager in this hierarchy:
  3033.  
  3034.         XtCreateWidget(realize_parent, PanedWindow);
  3035.         XtManageChild(PanedWindow);
  3036.  
  3037.         XtCreateWidget(PanedWindow, manager);
  3038.         XtManageChild(manager);
  3039.  
  3040.         XtCreateWidget(manager, button);
  3041.         XtManageChild(button);
  3042.  
  3043. That doesn't work anymore since the button management results in
  3044. its parent manager's ChangeManaged being called, which in turn makes a
  3045. *request* to the PanedWindow, resulting in a No reply because
  3046. of allowResize (set to False by default).
  3047.  
  3048. The PanedWindow parent wouldn't have been realized that everything
  3049. would have worked fine, since no request would have been made.
  3050. It really depends on the early realization scheme.
  3051.  
  3052. I think XmNresizable in Form is the only other resource to present
  3053. this problem. There is not much to do in those cases except than
  3054. setting the corresponding resource to True, which makes sense.
  3055.  
  3056.  
  3057. -----------------------------------------------------------------------------
  3058. Subject: 62)  TOPIC: TEXT WIDGET
  3059.  
  3060. -----------------------------------------------------------------------------
  3061. Subject: 63)  How do XmTextField and a single line XmText widget differ?
  3062.  
  3063. [Last modified: Oct 94]
  3064.  
  3065. Answer: XmTextField is designed to be a lightweight, single line text editor.
  3066. It does not provide as much functionality as does XmText in order to achieve
  3067. better performance.
  3068.  
  3069. Thanks to Kevin Till, kev@osf.org
  3070.  
  3071. -----------------------------------------------------------------------------
  3072. Subject: 64)  Why does  pressing  <return> in a text widget do nothing?  This
  3073. happens using Motif 1.0 when I have a text widget inside a bulletin board (or
  3074. form) inside a dialog shell. (In Motif 1.1 it is fixed for both text and list
  3075. widgets.)
  3076.  
  3077. Answer: In single line mode, pressing the <return> key usually invokes the
  3078. activate() action, and in multi-line mode, the newline() action.  However,
  3079. whenever a widget is the child of a bulletin board widget which is the child
  3080. of a dialog shell, the bulletin board forces all of its children to translate
  3081. <return> to the bulletin board action Return() which is usually associated
  3082. with the default button of the dialog.  To restore the text actions of
  3083. activate() or newline(), you need to overide the Return() action of the
  3084. bulletin board.
  3085.  
  3086.  
  3087.         /* declarations */
  3088.         /* for a single line widget */
  3089.         char newTrans[] = "<Key>Return : activate()";
  3090.         /* for a multi line widget */
  3091.         char newTrans[] = "<Key>Return : newline()";
  3092.         XtTranslations transTable;
  3093.  
  3094.         /* in executable section */
  3095.  
  3096.         transTable = XtParseTranslationTable(newTrans);
  3097.  
  3098.         /* after creating but before managing text widget */
  3099.  
  3100.         XtOverrideTranslations(textWidget, transTable);
  3101.  
  3102.  
  3103. -----------------------------------------------------------------------------
  3104. Subject: 65)  When I add text to a scrolling text widget, how can I get the
  3105. new text to show?
  3106.  
  3107. [Last modified: Sept 94]
  3108.  
  3109. Answer: Use the (fully supported) function XmTextShowPosition:
  3110.  
  3111.         void XmTextShowPosition(w, position)
  3112.         Widget w;
  3113.         XmTextPosition position;
  3114.  
  3115. where the position is the number of characters from the beginning of the
  3116. buffer of the text to be displayed. If you don't know how many characters are
  3117. in the buffer, use XmTextGetLastPosition.
  3118.  
  3119.         position = XmTextGetLastPosition(w)
  3120.  
  3121.  
  3122. -----------------------------------------------------------------------------
  3123. Subject: 66)  Does the text widget support 16 bit character fonts?
  3124.  
  3125.  
  3126. [Last modified: November 92]
  3127.  
  3128. Answer: R5 has support for 16 bit character sets, and Motif 1.2 uses that.
  3129. Neither Motif 1.0 nor 1.1 support 16 bit sets.
  3130.  
  3131. -----------------------------------------------------------------------------
  3132. END OF PART TWO
  3133. Archive-name: motif-faq/part3
  3134. Last-modified: FEB 11, 1995
  3135. Posting-Frequency: monthly
  3136. Organization: Century Computing, Inc.
  3137. Version: 4.1
  3138.  
  3139.  
  3140.  
  3141. -----------------------------------------------------------------------------
  3142. Subject: 67)  How can I stop the text widget from echoing characters typed?  I
  3143. need to turn off echo for password input.
  3144.  
  3145. Answer: Use the XmNmodifyVerifyCallback to tell when input is received. Set
  3146. the `doit' field in the XmTextVerifyCallbackStruct to False to stop the echo.
  3147. (In Motif 1.0 this will cause a beep per character: Live with it, because at
  3148. 1.1 you can turn it off.) Note that password hiding is inherently insecure in
  3149. X - someone may have an X grab on the keyboard and be reading all characters
  3150. typed in anyway.
  3151.  
  3152. Another solution often proposed is to set the foreground and background
  3153. colours to be the same, effectively hiding the text.  This has a major flaw:
  3154. someone may select the text (triple click the mouse to get the line), and then
  3155. paste the password into say an xterm with *different* foreground and
  3156. background colours.  This immediately shows the password.
  3157.  
  3158. -----------------------------------------------------------------------------
  3159. Subject: 68)  How can I replace characters typed with say a `*'?  I want to
  3160. replace input for password entry.
  3161.  
  3162. [Last modified: April 93]
  3163.  
  3164. Answer: In Motif 1.1 Use the modifyVerifyCallback to tell when input is
  3165. received.  Set text->ptr in the callback structure to '*'. This does not work
  3166. under 1.0 because of an oversight in which changes to this are ignored.  In
  3167. Motif 1.0, what you can do is set the doit flag to 'false' so the text is not
  3168. displayed. Then set a static boolean to True to prevent re-entrance.  Next
  3169. call XmTextReplace() to display your '*'.  then reset your re-entrance flag to
  3170. False.  XmTextReplace() will call the XmNmodifyVerify callback.  To prevent
  3171. getting into an infinite loop, you need the re-entrance flag.
  3172.  
  3173. The following program from Dan Heller illustrates this:
  3174.  
  3175. --------------
  3176. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  3177.  * This program is freely distributable without licensing fees and
  3178.  * is provided without guarantee or warranty expressed or implied.
  3179.  * This program is -not- in the public domain.  This program appears
  3180.  * in the Motif Programming Manual, O'Reilly Volume 6.
  3181.  */
  3182.  
  3183. /* passwd.c -- prompt for a passwd.  Meaning, all input looks like
  3184.  * a series of *'s.  Store the actual data typed by the user in
  3185.  * an internal variable.  Don't allow paste operations.  Handle
  3186.  * backspacing by deleting all text from insertion point to the
  3187.  * end of text.
  3188.  */
  3189. #include <Xm/Text.h>
  3190. #include <Xm/LabelG.h>
  3191. #include <Xm/RowColumn.h>
  3192. #include <ctype.h>
  3193.  
  3194. void check_passwd();
  3195. char *passwd; /* store user-typed passwd here. */
  3196.  
  3197. main(argc, argv)
  3198. int argc;
  3199. char *argv[];
  3200. {
  3201.     Widget        toplevel, text_w, rowcol;
  3202.     XtAppContext  app;
  3203.  
  3204.     toplevel = XtVaAppInitialize(&app, "Demos",
  3205.         NULL, 0, &argc, argv, NULL, NULL);
  3206.  
  3207.     rowcol = XtVaCreateWidget("rowcol",
  3208.         xmRowColumnWidgetClass, toplevel,
  3209.         XmNorientation, XmHORIZONTAL,
  3210.         NULL);
  3211.  
  3212.     XtVaCreateManagedWidget("Password:",
  3213.         xmLabelGadgetClass, rowcol, NULL);
  3214.     text_w = XtVaCreateManagedWidget("text_w",
  3215.         xmTextWidgetClass, rowcol, NULL);
  3216.  
  3217.     XtAddCallback(text_w, XmNmodifyVerifyCallback, check_passwd, NULL);
  3218.     XtAddCallback(text_w, XmNactivateCallback, check_passwd, NULL);
  3219.  
  3220.     XtManageChild(rowcol);
  3221.     XtRealizeWidget(toplevel);
  3222.     XtAppMainLoop(app);
  3223. }
  3224.  
  3225. void
  3226. check_passwd(text_w, unused, cbs)
  3227. Widget        text_w;
  3228. XtPointer     unused;
  3229. XmTextVerifyCallbackStruct *cbs;
  3230. {
  3231.     char *new;
  3232.     int len;
  3233.  
  3234.     if (cbs->reason == XmCR_ACTIVATE) {
  3235.         printf("Password: %s\n", passwd);
  3236.         return;
  3237.     }
  3238.  
  3239.     if (cbs->text->ptr == NULL) { /* backspace */
  3240.         cbs->endPos = strlen(passwd); /* delete from here to end */
  3241.         if (cbs->endPos <= 0) return; /* catch null passwd - Mark Scoville */
  3242.         passwd[cbs->startPos] = 0; /* backspace--terminate */
  3243.         return;
  3244.     }
  3245.  
  3246.     if (cbs->text->length > 1) {
  3247.         cbs->doit = False; /* don't allow "paste" operations */
  3248.         return; /* make the user *type* the password! */
  3249.     }
  3250.  
  3251.     new = XtMalloc(cbs->endPos + 2); /* new char + NULL terminator */
  3252.     if (passwd) {
  3253.         strcpy(new, passwd);
  3254.         XtFree(passwd);
  3255.     } else
  3256.         new[0] = NULL;
  3257.     passwd = new;
  3258.     strncat(passwd, cbs->text->ptr, cbs->text->length);
  3259.     passwd[cbs->endPos + cbs->text->length] = 0;
  3260.  
  3261.     for (len = 0; len < cbs->text->length; len++)
  3262.         cbs->text->ptr[len] = '*';
  3263. }
  3264.  
  3265.  
  3266. -----------------------------------------------------------------------------
  3267. Subject: 69)  How can I best add a large piece of text to a scrolled text
  3268. widget?
  3269.  
  3270. [Last modified: Sept 94]
  3271.  
  3272. [NOTE: This problem is probably only relevant for Motif 1.0 which probably no
  3273. one is using anymore. If you know this to still be a problem, send mail to
  3274. ksall@cen.com. I'll probably remove this question otherwise.]
  3275.  
  3276. In some versions of Motif 1.0 even using XmTextSetString, it insists on adding
  3277. the text one line at a time, adjusting the scroll bar each time. It looks
  3278. awful and is slow.
  3279.  
  3280. Answer: If you don't have this problem, use XmTextSetString to set all of the
  3281. text in the widget.  If you do have this slowdown problem even using
  3282. XmTextSetString, unmanage the widget, add the text and then manage it again.
  3283. This may cause the window to blink, but you have to put up with that or switch
  3284. to a different version of Motif.
  3285.  
  3286. -----------------------------------------------------------------------------
  3287. Subject: 70)  How can I highlight text in the Text widget?
  3288.  
  3289. Answer: From: argv@zipcode.com (Dan Heller)
  3290.  
  3291. If you don't need font or color changes, you can do all this using a Text
  3292. widget very easily [in Motif 1.1, anyway].
  3293.  
  3294.         loop() {
  3295.             pos = offset_of_pattern_in_text_widget(pattern, text_w);
  3296.             search_len = strlen(pattern);
  3297.             XmTextSetHighlight(text_w, pos, pos+search_len,
  3298.                         XmHIGHLIGHT_SELECTED);
  3299.         }
  3300.  
  3301.  
  3302. There are two choices for highlighting: reverse video (HIGHLIGHT_SELECTED) and
  3303. underlined (HIGHLIGHT_SECONDARY_SELECTED).  Be careful that your users won't
  3304. confuse your highlights with actual selections!
  3305.  
  3306. -----------------------------------------------------------------------------
  3307. Subject: 71)  How can I select all of the text in a widget programmatically?
  3308. So that some initial text is displayed, but anything typed replaces it.
  3309.  
  3310. Answer: XmTextSetSelection(Text1, 0, XmTextGetLastPosition(Text1), event-
  3311. >xbutton.time);
  3312.  
  3313. where Text1 is the widget in question (obviously) and event is some event that
  3314. triggered this call.  You can use XtLastTimestampProcessed( display) instead
  3315. of xbutton.time if you don't happen to have an event pointer handy.
  3316.  
  3317.  
  3318. -----------------------------------------------------------------------------
  3319. Subject: 72)  How can I change colours of text in the Text widget?  I want
  3320. some of the text in one colour, some in another.
  3321.  
  3322. Answer: You can't.  Text stores an ordinary string, and points where
  3323. `highlights' of various types begin and end.  These highlights are all the
  3324. control you have over components of the text.  See the previous question.
  3325.  
  3326.  
  3327. -----------------------------------------------------------------------------
  3328. Subject: 73)  How can I change the font of text in the Text widget?  I want
  3329. some of the text in one font, some in another.
  3330.  
  3331. [Last modified: Sept 94]
  3332.  
  3333. Answer: You can't in Text (see the previous question).  If you wanted readonly
  3334. text, you could do it by using a label instead.  Label uses XmStrings, which
  3335. can contain multiple character sets in the one string.
  3336.  
  3337. If you are using Motif 2.0, however, XmStrings are now permitted in XmText
  3338. widgets, which solves this particular problem.
  3339.  
  3340. -----------------------------------------------------------------------------
  3341. Subject: 74)  Is there an emacs binding for the text widget?
  3342.  
  3343. Answer: This set is due to Kee Hinckley (nazgul@utopia.com):
  3344.  
  3345. *XmText.translations: #override\n\
  3346.         Ctrl <Key>b:            backward-character()\n\
  3347.         Alt <Key>b:             backward-word()\n\
  3348.         Meta <Key>b:            backward-word()\n\
  3349.         Shift Alt <Key>b:       backward-word(extend)\n\
  3350.         Shift Meta <Key>b:      backward-word(extend)\n\
  3351.         Alt <Key>[:             backward-paragraph()\n\
  3352.         Meta <Key>[:            backward-paragraph()\n\
  3353.         Shift Alt <Key>[:       backward-paragraph(extend)\n\
  3354.         Shift Meta <Key>[:      backward-paragraph(extend)\n\
  3355.         Alt <Key><:             beginning-of-file()\n\
  3356.         Meta <Key><:            beginning-of-file()\n\
  3357.         Ctrl <Key>a:            beginning-of-line()\n\
  3358.         Shift Ctrl <Key>a:      beginning-of-line(extend)\n\
  3359.         Ctrl <Key>osfInsert:    copy-clipboard()\n\
  3360.         Shift <Key>osfDelete:   cut-clipboard()\n\
  3361.         Shift <Key>osfInsert:   paste-clipboard()\n\
  3362.         Alt <Key>>:             end-of-file()\n\
  3363.         Meta <Key>>:            end-of-file()\n\
  3364.         Ctrl <Key>e:            end-of-line()\n\
  3365.         Shift Ctrl <Key>e:      end-of-line(extend)\n\
  3366.         Ctrl <Key>f:            forward-character()\n\
  3367.         Alt <Key>]:             forward-paragraph()\n\
  3368.         Meta <Key>]:            forward-paragraph()\n\
  3369.         Shift Alt <Key>]:       forward-paragraph(extend)\n\
  3370.         Shift Meta <Key>]:      forward-paragraph(extend)\n\
  3371.         Ctrl Alt <Key>f:        forward-word()\n\
  3372.         Ctrl Meta <Key>f:       forward-word()\n\
  3373.         Ctrl <Key>d:            kill-next-character()\n\
  3374.         Alt <Key>BackSpace:     kill-previous-word()\n\
  3375.         Meta <Key>BackSpace:    kill-previous-word()\n\
  3376.         Ctrl <Key>w:            key-select() kill-selection()\n\
  3377.         Ctrl <Key>y:            unkill()\n\
  3378.         Ctrl <Key>k:            kill-to-end-of-line()\n\
  3379.         Alt <Key>Delete:        kill-to-start-of-line()\n\
  3380.         Meta <Key>Delete:       kill-to-start-of-line()\n\
  3381.         Ctrl <Key>o:            newline-and-backup()\n\
  3382.         Ctrl <Key>j:            newline-and-indent()\n\
  3383.         Ctrl <Key>n:            next-line()\n\
  3384.         Ctrl <Key>osfLeft:      page-left()\n\
  3385.         Ctrl <Key>osfRight:     page-right()\n\
  3386.         Ctrl <Key>p:            previous-line()\n\
  3387.         Ctrl <Key>g:            process-cancel()\n\
  3388.         Ctrl <Key>l:            redraw-display()\n\
  3389.         Ctrl <Key>osfDown:      next-page()\n\
  3390.         Ctrl <Key>osfUp:        previous-page()\n\
  3391.         Ctrl <Key>space:        set-anchor()\n
  3392.  
  3393.  
  3394. ! If you'd like the Delete key to work like backspace instead of deleting
  3395. ! backwards, add the following definition to the lines above.
  3396. !       <Key>osfDelete: delete-previous-character()\n\
  3397.  
  3398. ! These aren't included because they could intefere with
  3399. | menu accelerators (or vice versa)
  3400. !       Alt <Key>p:             backward-paragraph()\n\
  3401. !       Meta <Key>p:            backward-paragraph()\n\
  3402. !       Shift Alt<Key>p:        backward-paragraph(extend)\n\
  3403. !       Shift Meta<Key>p:       backward-paragraph(extend)\n\
  3404. !       Alt <Key>w:             copy-clipboard()\n\
  3405. !       Meta <Key>w:            copy-clipboard()\n\
  3406. !       Ctrl Alt <Key>w:        cut-clipboard()\n\
  3407. !       Ctrl Meta <Key>w:       cut-clipboard()\n\
  3408. !       Alt <Key>y:             paste-clipboard()\n\
  3409. !       Meta <Key>y:            paste-clipboard()\n\
  3410. !       Alt <Key>f:             forward-word()\n\
  3411. !       Meta <Key>f:            forward-word()\n\
  3412. !       Alt <Key>n:             forward-paragraph()\n\
  3413. !       Meta <Key>n:            forward-paragraph()\n\
  3414. !       Shift Alt <Key>n:       forward-paragraph(extend)\n\
  3415. !       Shift Meta <Key>n:      forward-paragraph(extend)\n\
  3416. !       Shift Alt <Key>f:       forward-word(extend)\n\
  3417. !       Shift Meta <Key>f:      forward-word(extend)\n\
  3418. !       Alt <Key>d:             kill-next-word()\n\
  3419. !       Meta <Key>d:            kill-next-word()\n\
  3420. !       Alt <Key>h:             select-all()\n\
  3421. !       Meta <Key>h:            select-all()\n\
  3422.  
  3423. Similar sets of translations have been suggested by others.
  3424.  
  3425. -----------------------------------------------------------------------------
  3426. Subject: 75)  What if I have problems with the backspace/delete keys?
  3427.  
  3428. [Last modified: Dec 94]
  3429.  
  3430. Answer: mclarnon@maths.ox.ac.uk (Gerald.McLarnon) writes:
  3431.  
  3432.   I am running a precompiled program based on motif and am having some
  3433. problems
  3434.   with the backspace/delete keys. Following the instructions of the faq I put
  3435. th e
  3436.   following lines in my .Xdefaults file
  3437.  
  3438.      *XmText.translations: #override                     <Key>osfDelete:
  3439. delete-previous-character()
  3440.      *XmTextField.translations: #override                     <Key>osfDelete:
  3441. delete-previous-character()
  3442.   This meant that in dialogue boxes (such as 'Open File') the delete key
  3443.   deleted to the left, but not in the main application window.
  3444.  
  3445.   Any hints for someone who isn't much of an X-pert?
  3446.  
  3447. David Kaelbling <drk@x.org> replied:
  3448.  
  3449. There are a couple possibilities.  In addition to the precedence of loading
  3450. resource files (explained in section 2.3 of the X11R5 X Toolkit Intrinsics
  3451. manual), resource values in the database are chosen based on a "most explicit
  3452. match" algorithm (i.e. those with the most qualifiers on the left hand side
  3453. win -- see section 15.2 of the X11R5 Xlib - C Library manual).  So if this
  3454. application's app-defaults file or fallback resources says
  3455. *Foo*XmText.translations:... that value will be used instead of yours.
  3456.  
  3457. Find the app-defaults file for your application and look to see if it
  3458. specifies translations for text widgets in the main application; if it does
  3459. you'll need to make yours at least as explicit.
  3460.  
  3461. If the app-defaults file isn't the problem then the application may be hard-
  3462. wiring the translations.  If that's the case you'll probably have to change
  3463. your virtual key bindings so that the key you think of as osfDelete is really
  3464. osfBackSpace.  You can do that for an individual application by setting its
  3465. defaultVirtualBindings resource, or for all Motif applications with a
  3466. $HOME/.motifbind file ("man xmbind" and "man VirtualBindings" give more detail
  3467. and alternatives).  In either case you'll need to specify a complete list of
  3468. virtual key bindings; there is no equivalent to #override.  To find out your
  3469. current virtual key bindings run "xprop -root | fgrep BINDINGS" and clean up
  3470. the result.
  3471.  
  3472. -----------------------------------------------------------------------------
  3473. Subject: 76)  How can I use a file as the text source for a Text widget?
  3474.  
  3475. Answer: You can't do it directly like you can with the Athena Text widget.
  3476. Instead, read the text from the file into a string (all of it!) and then use
  3477. XmTextSetString.  Alternatively, read blocks of characters and add them at the
  3478. end of the text using XmTextInsertString.  The following is an excerpt from
  3479. Dan Heller's "file_browser.c":
  3480.  
  3481.     /* file_browser.c -- use a ScrolledText object to view the
  3482.      * contents of arbitrary files chosen by the user from a
  3483.      * FileSelectionDialog or from a single-line text widget.
  3484.      */
  3485.  
  3486.     ...
  3487.     struct stat statb;
  3488.  
  3489.     /* make sure the file is a regular text file and open it */
  3490.     if (stat(filename, &statb) == -1 ||
  3491.             (statb.st_mode & S_IFMT) != S_IFREG ||
  3492.             !(fp = fopen(filename, "r"))) {
  3493.         if ((statb.st_mode & S_IFMT) == S_IFREG)
  3494.             perror(filename); /* send to stderr why we can't read it */
  3495.         else
  3496.             fprintf(stderr, "%s: not a regular file0, filename);
  3497.         XtFree(filename);
  3498.         return;
  3499.     }
  3500.  
  3501.     /* put the contents of the file in the Text widget by allocating
  3502.      * enough space for the entire file, reading the file into the
  3503.      * allocated space, and using XmTextFieldSetString() to show the file.
  3504.      */
  3505.     if (!(text = XtMalloc((unsigned)(statb.st_size+1)))) {
  3506.         fprintf(stderr, "Can't alloc enough space for %s", filename);
  3507.         XtFree(filename);
  3508.         fclose(fp);
  3509.         return;
  3510.     }
  3511.  
  3512.     if (!fread(text, sizeof(char), statb.st_size+1, fp))
  3513.         fprintf(stderr, "Warning: may not have read entire file!0);
  3514.  
  3515.     text[statb.st_size] = 0; /* be sure to NULL-terminate */
  3516.  
  3517.     /* insert file contents in Text widget */
  3518.     XmTextSetString(text_w, text);
  3519.  
  3520.  
  3521. -----------------------------------------------------------------------------
  3522. Subject: 77)* How can put Text in overstrike mode instead of insert?
  3523.  
  3524. [Last modified: Feb 95]
  3525.  
  3526. Answer: (Be sure to read the update after the first answer.)
  3527.  
  3528. There is no direct way. This was posted by Edmond Pitt (ejp@bohra.cpg.oz) The
  3529. correct answer to the question is to put the following in a modifyVerify
  3530. callback, where 'mvcb' is the XmTextVerifyCallbackStruct, and 'overstriking'
  3531. is defined by you:
  3532.  
  3533.     if (overstriking && mvcb->text->length == 1)
  3534.     {
  3535.         _XmTextDisableRedisplay(w,FALSE);
  3536.         XtCallActionProc(w,"delete-next-character",mvcb->event,0);
  3537.         _XmTextEnableRedisplay(w);
  3538.     }
  3539.  
  3540. _XmText{Dis,En}ableRedisplay() are XmText{Dis,En}ableRedisplay() in 1.0, but
  3541. X11R3 has no XtCallActionProc() anyway. For this environment you need my 1.0.3
  3542. Text widget patches posted last year & available on request.
  3543.  
  3544. An update was provided by Ingeborg (inca@osf.org):
  3545.  
  3546. In 1.2 and later releases, there is an action function toggle-overstrike()
  3547. which will toggle between overstrike and insert mode. Before 1.2.3, there is
  3548. no visual difference, and at most one character will get overstruck. In 1.2.3,
  3549. a block cursor was added as a visual cue to that the widget is in overstrike
  3550. mode, and the code was fixed to overstrike the actual number of characters
  3551. input (this makes a difference if you have preediting - for example in
  3552. japanese).
  3553.  
  3554. There is no default binding in 1.2, but the recommended key is osfInsert
  3555. without modifiers.  No resource exists.
  3556.  
  3557.  
  3558. Ed Kaltenbach (kaltenba@ataway.aptec.com) wrote:
  3559.  
  3560.     I was simulating overstrike mode in the Text Field widget by using
  3561.     the delete_next_character solution listed in subject 71.
  3562.     When the software is compiled with Motif 1.2.2, the modifyVerify
  3563.     callback does not get called for the last character when XmNmaxLength
  3564.     is specified.  It seems that the check if maxLength has been reached
  3565.     is done before the modifyVerify gets called and it keeps the modifyVerify
  3566.     from being called.  Is this a Motif bug? Does anybody have a solution that
  3567.     will work with Versions 1.1 and 1.2 of Motif?
  3568.  
  3569.  
  3570. Phil Day <phil@cfmu.eurocontrol.be> responded to Ed (and apologized for only
  3571. sending pseudocode!):
  3572.  
  3573. I've had the same problem, and for my money it's a bug.  My workaround is to
  3574. make all text widgets (I don't use textfield because of some other problems in
  3575. the past) have XmNmaxLength > XmNcolumns, so that the modifyVerify callback
  3576. gets a chance to do its stuff.
  3577.  
  3578. If you only want to support overstrike for typing, 1 extra charater is enough,
  3579. but if you want to support cut-and-paste for any length string you need
  3580. maxLength = 2*columns.  In the modifyVerify you have to check the result is <
  3581. columns.
  3582.  
  3583. I've tried using the Motif 1.2 support for overstrike, but this just seems to
  3584. work on a kind of pending-delete and only works for the single charater
  3585. replacement caes (that's my main argument for calling it a bug).
  3586.  
  3587. I don't use delete-next-charater (I can't remember why just now, but I know I
  3588. had some problem with it).  Instead I have something like the following:
  3589.  
  3590. modifyVerify()
  3591. {
  3592.         if (acceptable)
  3593.                 XmReplaceText(...)
  3594.  
  3595.         cd->doit = False;
  3596.         // we've just done it, we don't wnat Motif to !
  3597.  
  3598.     XtVaSetValues (w,
  3599.                    XmNverifyBell, False,
  3600.                    NULL);
  3601.         // Otherwise we'll get a beep.
  3602. }
  3603.  
  3604. valueChanged()
  3605. {
  3606.  
  3607.     XtVaSetValues (w,
  3608.                    XmNverifyBell, True,
  3609.                    NULL);
  3610.         // turned off in modifyVerify
  3611.  
  3612. }
  3613.  
  3614. -----------------------------------------------------------------------------
  3615. Subject: 78)  How can I make the Delete key do a Backspace?  Related question:
  3616. How can I swap Delete and Backspace?
  3617.  
  3618. [Last modified: Oct 94]
  3619.  
  3620. Answer: Put this in your .Xdefaults
  3621.  
  3622.     *XmText.translations: #override <Key>osfDelete: delete-previous-character()
  3623.  
  3624.  
  3625. Additional information from David Kaelbling <drk@x.org>:
  3626.  
  3627. You can also supply an arbitrary file name to xmbind (so you can conditionally
  3628. run xmbind from your .xinitrc file based on the hostname, architecture,
  3629. xdpyinfo output, or whatever).
  3630.  
  3631. Some people prefer to use xmodmap to swap the keysyms for all applications,
  3632. but what you're doing will work fine if you specify all of the virtual key
  3633. bindings.  The current bindings are stored on the root window -- use "xprop
  3634. -root" and look for a _MOTIF_BINDINGS or _MOTIF_DEFAULT_BINDINGS property.
  3635. OSF/Motif is also distributed with a "bindings" directory containing all the
  3636. fallback virtkey binding files.
  3637.  
  3638. There are several ways to do display-specific customization: make
  3639.  
  3640. -----------------------------------------------------------------------------
  3641. Subject: 79)  TOPIC: LIST WIDGET
  3642.  
  3643. -----------------------------------------------------------------------------
  3644. Subject: 80)  Should I create an XmList widget as a child of automatic
  3645. XmScrolledWindow or use the XmCreateScrolledList() convenience function?
  3646.  
  3647. Answer: With most implementations, the convenience function use internal hooks
  3648. to give somewhat better scrolling performance.
  3649.  
  3650. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  3651.  
  3652. -----------------------------------------------------------------------------
  3653. Subject: 81)  How do I best put a new set of items into a list?
  3654.  
  3655. Answer: Set the new list count and list by XtSetArgs and install them by
  3656. XtSetValues.
  3657.  
  3658.     XmString list[SIZE];
  3659.     int list_size;
  3660.  
  3661.     XtSetArg (args[n], XmNitemCount, list_size); n++;
  3662.     XtSetArg (args[n], XmNitems, list); n++;
  3663.     XtSetValues (w, args, n);
  3664.  
  3665.  
  3666. or similarly with XtVaSetValues:
  3667.  
  3668.  
  3669.     XtVaSetValues (w,
  3670.        XmNitemCount, list_size,
  3671.        XmNitems, list,
  3672.        NULL);
  3673.  
  3674.  
  3675. Each time the list is reset by this the old contents are freed by the widget
  3676. and the new supplied list is copied.  Do *not* free the old list of items
  3677. yourself as this would result in the space being freed twice.  It is not
  3678. necessary to remove the items one at a time, nor to "zero" out the list first.
  3679.  
  3680. -----------------------------------------------------------------------------
  3681. Subject: 82)  Can I have strings with different fonts in a list?
  3682.  
  3683. Answer: Yes. The strings are XmStrings. Each one can be created using a
  3684. different character set using a different font.
  3685.  
  3686.  
  3687. -----------------------------------------------------------------------------
  3688. Subject: 83)  Can I get a bitmap to show in a list item like I can in a Label?
  3689. I want to place a bitmap along with some normal text in my list items.
  3690.  
  3691. Answer: No. The list contains XmStrings, and these only allow text in various
  3692. character sets. The workaround is to define your font containing the icons you
  3693. want. Then you can create a fontlist containing your icon font and the font
  3694. you want the text in, and then make your items multi-segment XmStrings where
  3695. the first segment contains the code of the icon you want with a charset that
  3696. matches the icon font in your fontlist and the second segment with a charset
  3697. matching the text font.
  3698.  
  3699.  
  3700. -----------------------------------------------------------------------------
  3701. Subject: 84)  Can I have items with different colours in a list?
  3702.  
  3703. Answer: No.  The list contains XmStrings, and these only allow text in various
  3704. character sets. Since the items are XmStrings, you can already change the font
  3705. of an item by replacing it with an item with the same text and a different
  3706. charset tag.  Adding support for color would require modification of the
  3707. internal data structure in XmList as well as modification to the drawing
  3708. routines.  A possible workaround is to use a rowcolumn of buttons which can be
  3709. individually set.  However, you would have to do all list functionality
  3710. yourself.
  3711.  
  3712.  
  3713. -----------------------------------------------------------------------------
  3714. Subject: 85)  Can I grey out an item in a list?  I want to make insensitive
  3715. items in a list so that they cannot be selected.
  3716.  
  3717. Answer:
  3718.  
  3719. From W. Scott Meeks of OSF:
  3720.  
  3721. Unfortunately, you can't do it directly since the list items aren't individual
  3722. widgets.  We've had other requests for this technology, but it didn't make the
  3723. cut for 1.2; it should be in some future release.
  3724.  
  3725. However, you can probably fake it in your application with some difficulty.
  3726. First, a list item is an XmString, so you can specify a different charset for
  3727. the item than for other items in the list and then specify a font in the
  3728. list's fontlist that matches the charset and gives you the visual you want.
  3729. The next problem is making the item unselectable.  One idea would be to have
  3730. the application keep track of the insensitive items and the items currently
  3731. selected.  Then you would set up a selection callback that when called would
  3732. check the item selected against the list of insensitive items and if the
  3733. selected item matched would deselect that item and reselect the previously
  3734. selected items.  Otherwise it would just update the application's list of
  3735. selected items.  The major drawback with this approach is that you'll get
  3736. flashing whenever the list selects an item and your application immediately
  3737. de-selects.  Unfortunately I can't think of a way around this without mucking
  3738. with the list internals.
  3739.  
  3740. Another alternative suggested is to use instead a column of say read only text
  3741. widgets which you can make insensitive.
  3742.  
  3743. -----------------------------------------------------------------------------
  3744. Subject: 86)  Can I have multi-line items in a list?
  3745. [Last modified: August 92]
  3746.  
  3747. Answer: Motif 1.0 and 1.1 both have problems with multi-line items in a list.
  3748. They should work okay in Motif 1.2.
  3749.  
  3750. -----------------------------------------------------------------------------
  3751. Subject: 87)  How can I tell the position of selected items in a list?
  3752.  
  3753. [Last modified: Oct 92]
  3754.  
  3755. Answer: From  W. Scott Meeks:
  3756.  
  3757. 1) All XmList selection callbacks get an XmListCallbackStruct which includes
  3758. the item selected and its position.  In addition, the multiple and extended
  3759. selection callbacks also get a list of the selected items.  This approach
  3760. requires that your application saves this information if you need it outside
  3761. of the immediate callback.
  3762.  
  3763.  
  3764. 2) At any time you can XtGetValues the XmNselectedItems and
  3765. XmNselectedItemCount resources.  The problem with this approach is that
  3766. identical items may or may not show up in multiple times in this list and the
  3767. position in the selectedItems list may not relate directly to the position in
  3768. the items list.
  3769.  
  3770. 3) You can call XmListGetSelectedPos on the list widget.  This will return a
  3771. list of the positions of all selected items.
  3772.  
  3773. -----------------------------------------------------------------------------
  3774. Subject: 88)  TOPIC: FILE SELECTION BOX WIDGET
  3775.  
  3776. -----------------------------------------------------------------------------
  3777. Subject: 89)  What is libPW.a and do I need it?  My manual says I need to link
  3778. in libPW.a to use the File Selection Box.  I can't find it on my system.
  3779.  
  3780. [Last modified: Sept 94]
  3781.  
  3782. Answer: The libPW.a is the Programmers Workbench library which is an ATT
  3783. product not included in Berkeley based systems, hence it is not found in SunOS
  3784. or Ultrix, but is found on HP-UX (a Berkeley/ATT hybrid which chose ATT in
  3785. this case).  It contains the regex(3) routines (regcmp, regex).  Some systems
  3786. which don't have these in the libc.a need to link with -lPW.  Some systems
  3787. which have the regex(3) routines in there also have the libPW.a.  If you have
  3788. regex(3) in libc, and it works, don't link with libPW.  If you don't have
  3789. regex(3) in libc, and you don't have a libPW, then check some sites on the net
  3790. for public domain replacements (several exist), or call your vendor.
  3791.  
  3792. In most versions of Motif (see the doco), you can compile FileSB.c with
  3793. -DNO_REGEX if you don't have it.
  3794.  
  3795.  
  3796. Casper H.S. Dik (asper@fwi.uva.nl), Faculty of Mathematics & Computer Science,
  3797. University of Amsterdam, sent this update for Solaris 2.x users:
  3798.  
  3799. The regex and regcmp function are part of libgen in SVR4.  Motif applications
  3800. should be linked with -lgen. (However, some SVR4 implementations, especially
  3801. those of vendors that once shipped SVR3 still contain libPW.)
  3802.  
  3803. On Solaris 2.x system, you'll need libgen which is located in /usr/ccs/lib.
  3804.  
  3805. -----------------------------------------------------------------------------
  3806. Subject: 90)  What are these compile errors: Undefined symbol _regcmp and
  3807. _regex?
  3808.  
  3809. [Last modified: Sept 94]
  3810.  
  3811. Answer: You need to link in the libPW or libgen library - see previous
  3812. question.
  3813.  
  3814.  
  3815. -----------------------------------------------------------------------------
  3816. Subject: 91)  What's wrong with the Motif 1.0 File Selection Box?  I can't set
  3817. the directory, change the directory or get the file mask to work.
  3818.  
  3819. Answer: The 1.0 File Selection Box is broken, and these don't work.  They
  3820. weren't fixed until Motif 1.04.  Use these later versions of 1.0 or switch to
  3821. Motif 1.1 where it changed a lot.
  3822.  
  3823. Joe Hildebrand has a work-around for some of this: Before popping up an
  3824. XmFileSelectionDialog, change to the directory you want.  When a file is
  3825. selected, check if it is a directory, so that we can change to it.  i.e.
  3826.  
  3827. static void show_file_box_CB(w, client_data, call_data)
  3828.    Widget               w;
  3829.    Widget               client_data;
  3830.    XmAnyCallbackStruct  *call_data;
  3831. {
  3832.    chdir("/users/hildjj/files");
  3833.    XtManageChild(client_data);
  3834. }
  3835.  
  3836. static void val_save(w, client_data, call_data)
  3837.    Widget       w;
  3838.    Widget       client_data;
  3839.    XmSelectionBoxCallbackStruct *call_data;
  3840. {
  3841.    struct stat buf;  /* struct stat is defined in stat.h */
  3842.    char *filename;
  3843.  
  3844.    /* get the file name from the FileSelectionBox */
  3845.    filename = SmX(call_data->value);
  3846.  
  3847.    /* get the status of the file named filename, and put it into buf */
  3848.    if (!stat(filename, &buf))
  3849.    {
  3850.       /* if it's a directory */
  3851.       /* if it's a directory */
  3852.       if(S_ISDIR(buf.st_mode))
  3853.       {
  3854.          /* change to that directory, and update the FileSelectionBox */
  3855.         chdir(filename);
  3856.         XmFileSelectionDoSearch(w, NULL);
  3857.       }
  3858.       else
  3859.          /* if it's a regular file */
  3860.          if(S_ISREG(buf.st_mode))
  3861.             /* ask if it should be overwritten */
  3862.             XtManageChild(valbox);
  3863.          else
  3864.             /* it's another kind of file.  What type, i can't think of,
  3865.                but it might happen */
  3866.             pop_up_error_box(client_data, "Error saving file");
  3867.    }
  3868.    else  /* we couldn't get the file status */
  3869.    {
  3870.       /* if it's because the file doesn't exist, we're golden */
  3871.       if (errno == ENOENT)
  3872.          save_file();
  3873.       else   /* there is some other problem getting the status.
  3874.                 e.g. bad path */
  3875.          pop_up_error_box(client_data, "Error saving file");
  3876.    }
  3877. }
  3878.  
  3879. this still doesn't implement the file masking stuff.
  3880.  
  3881.  
  3882. -----------------------------------------------------------------------------
  3883. Subject: 92)  TOPIC: FORM WIDGET
  3884.  
  3885.  
  3886. -----------------------------------------------------------------------------
  3887. Subject: 93)  Why don't labels in a Form resize when the label is changed?
  3888. I've got some labels in a form. The labels don't resize whenever the label
  3889. string resource is changed. As a result, the operator has to resize the window
  3890. to see the new label contents. I am using Motif 1.1.
  3891.  
  3892. Answer: This problem may happen to any widget inside a Form widget. The
  3893. problem was that the Form will resize itself when it gets geometry requests
  3894. from its children. If its preferred size is not allowed, the Form will
  3895. disallow all geometry requests from its children. The workaround is that you
  3896. should set any ancestor of the Form to be resizable. For the shell which
  3897. contains the Form you should set the shell resource XmNallowShellResize to be
  3898. True (by default, it is set to FALSE).  There is currently an inconsistency on
  3899. how resizing is being done, and it may get fixed in Motif 1.2.
  3900.  
  3901. From db@sunbim.be (Danny Backx)
  3902.  
  3903. Basically what you have to do is set the XmNresizePolicy on the Form to
  3904. XmRESIZE_NONE.  The facts seem to be that XmRESIZE_NONE does NOT mean "do not
  3905. allow resizes".  You may also have to set XmNresizable on the form to True.
  3906.  
  3907. -----------------------------------------------------------------------------
  3908. Subject: 94)  How can I center a widget in a form?
  3909.  
  3910. Answer: One of Motif's trickier questions.  The problems are that: Form gives
  3911. no support for centering, only for edge attachments, and the widget must stay
  3912. in the center if the form or the widget is resized.  Just looking at
  3913. horizontal centering (vertical is similar) some solutions are:
  3914.  
  3915.  a.  Use the table widget instead of Form.
  3916.  
  3917.  b.  A hack free solution is from Dan Heller:
  3918.  
  3919.      /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  3920.       * This program is freely distributable without licensing fees and
  3921.       * is provided without guarantee or warranty expressed or implied.
  3922.       * This program is -not- in the public domain.  This program is
  3923.       * taken from the Motif Programming Manual, O'Reilly Volume 6.
  3924.       */
  3925.  
  3926.      /* corners.c -- demonstrate widget layout management for a
  3927.       * BulletinBoard widget.  There are four widgets each labeled
  3928.       * top-left, top-right, bottom-left and bottom-right.  Their
  3929.       * positions in the bulletin board correspond to their names.
  3930.       * Only when the widget is resized does the geometry management
  3931.       * kick in and position the children in their correct locations.
  3932.       */
  3933.      #include <Xm/BulletinB.h>
  3934.      #include <Xm/PushBG.h>
  3935.  
  3936.      char *corners[] = {
  3937.          "Top-Left", "Top-Right", "Bottom-Left", "Bottom-Right",
  3938.      };
  3939.  
  3940.      static void resize();
  3941.  
  3942.      main(argc, argv)
  3943.      int argc;
  3944.      char *argv[];
  3945.      {
  3946.          Widget toplevel, bboard;
  3947.          XtAppContext app;
  3948.          XtActionsRec rec;
  3949.          int i;
  3950.  
  3951.          /* Initialize toolkit and create toplevel shell */
  3952.          toplevel = XtVaAppInitialize(&app, "Demos", NULL, 0,
  3953.              &argc, argv, NULL, NULL);
  3954.  
  3955.          /* Create your standard BulletinBoard widget */
  3956.          bboard = XtVaCreateManagedWidget("bboard",
  3957.              xmBulletinBoardWidgetClass, toplevel, NULL);
  3958.  
  3959.          /* Set up a translation table that captures "Resize" events
  3960.           * (also called ConfigureNotify or Configure events).  If the
  3961.           * event is generated, call the function resize().
  3962.           */
  3963.          rec.string = "resize";
  3964.          rec.proc = resize;
  3965.          XtAppAddActions(app, &rec, 1);
  3966.          XtOverrideTranslations(bboard,
  3967.              XtParseTranslationTable("<Configure>: resize()"));
  3968.  
  3969.          /* Create children of the dialog -- a PushButton in each corner. */
  3970.          for (i = 0; i < XtNumber(corners); i++)
  3971.              XtVaCreateManagedWidget(corners[i],
  3972.                  xmPushButtonGadgetClass, bboard, NULL);
  3973.  
  3974.          XtRealizeWidget(toplevel);
  3975.          XtAppMainLoop(app);
  3976.      }
  3977.  
  3978.      /* resize(), the routine that is automatically called by Xt upon the
  3979.       * delivery of a Configure event.  This happens whenever the widget
  3980.       * gets resized.
  3981.       */
  3982.      static void
  3983.      resize(w, event, args, num_args)
  3984.      CompositeWidget w;   /* The widget (BulletinBoard) that got resized */
  3985.      XConfigureEvent *event;  /* The event struct associated with the event */
  3986.      String args[]; /* unused */
  3987.      int *num_args; /* unused */
  3988.      {
  3989.          WidgetList children;
  3990.          int width = event->width;
  3991.          int height = event->height;
  3992.          Dimension w_width, w_height;
  3993.          short margin_w, margin_h;
  3994.  
  3995.          /* get handle to BulletinBoard's children and marginal spacing */
  3996.          XtVaGetValues(w,
  3997.              XmNchildren, &children,
  3998.              XmNmarginWidth, &margin_w,
  3999.              XmNmarginHeight, &margin_h,
  4000.              NULL);
  4001.  
  4002.          /* place the top left widget */
  4003.          XtVaSetValues(children[0],
  4004.              XmNx, margin_w,
  4005.  
  4006.              XmNy, margin_h,
  4007.              NULL);
  4008.  
  4009.          /* top right */
  4010.          XtVaGetValues(children[1], XmNwidth, &w_width, NULL);
  4011.  
  4012.          /* To Center a widget in the middle of the BulletinBoard (or Form),
  4013.           * simply call:
  4014.           *   XtVaSetValues(widget,
  4015.                XmNx,    (width - w_width)/2,
  4016.                XmNy,    (height - w_height)/2,
  4017.                NULL);
  4018.           * and return.
  4019.           */
  4020.          XtVaSetValues(children[1],
  4021.              XmNx, width - margin_w - w_width,
  4022.              XmNy, margin_h,
  4023.              NULL);
  4024.          /* bottom left */
  4025.          XtVaGetValues(children[2], XmNheight, &w_height, NULL);
  4026.          XtVaSetValues(children[2],
  4027.  
  4028.              XmNx, margin_w,
  4029.              XmNy, height - margin_h - w_height,
  4030.              NULL);
  4031.          /* bottom right */
  4032.          XtVaGetValues(children[3],
  4033.              XmNheight, &w_height,
  4034.              XmNwidth, &w_width,
  4035.              NULL);
  4036.          XtVaSetValues(children[3],
  4037.              XmNx, width - margin_w - w_width,
  4038.              XmNy, height - margin_h - w_height,
  4039.              NULL);
  4040.      }
  4041.  
  4042.  c.  No uil solution has been suggested, because of the widget size problem
  4043.  
  4044. -----------------------------------------------------------------------------
  4045. Subject: 95)  How do I line up two columns of widgets of different types?  I
  4046. have a column of say label widgets, and a column of text widgets and I want to
  4047. have them lined up horizontally. The problem is that they are of different
  4048. heights. Just putting them in a form or rowcolumn doesn't line them up
  4049. properly because the label and text widgets are of different height.
  4050.  
  4051. If you want the geometry to look like this
  4052.  
  4053.           -------------------------------------
  4054.          |          -------------------------- |
  4055.          |a label  |Some text                 ||
  4056.          |          -------------------------- |
  4057.                            ------------------- |
  4058.          |a longer label  |Some more text     ||
  4059.          |                 ------------------- |
  4060.          |                    ---------------- |
  4061.          |a very long label  |Even more text  ||
  4062.          |                    ---------------- |
  4063.           -------------------------------------
  4064.  
  4065. try
  4066.  
  4067. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  4068.  * This program is freely distributable without licensing fees and
  4069.  * is provided without guarantee or warranty expressed or implied.
  4070.  * This program is -not- in the public domain.  This program is
  4071.  * taken from the Motif Programming Manual, O'Reilly Volume 6.
  4072.  */
  4073.  
  4074. /* text_form.c -- demonstrate how attachments work in Form widgets.
  4075.  * by creating a text-entry form type application.
  4076.  */
  4077.  
  4078. #include <Xm/PushB.h>
  4079. #include <Xm/PushBG.h>
  4080. #include <Xm/LabelG.h>
  4081. #include <Xm/Text.h>
  4082. #include <Xm/Form.h>
  4083.  
  4084. char *prompts[] = {
  4085.     "Name:", "Phone:", "Address:",
  4086.     "City:", "State:", "Zip:",
  4087. };
  4088.  
  4089. main(argc, argv)
  4090. int argc;
  4091. char *argv[];
  4092. {
  4093.     Widget toplevel, mainform, subform, label, text;
  4094.     XtAppContext app;
  4095.     char buf[32];
  4096.     int i;
  4097.  
  4098.     toplevel = XtVaAppInitialize(&app, "Demos", NULL, 0,
  4099.         &argc, argv, NULL, NULL);
  4100.  
  4101.     mainform = XtVaCreateWidget("mainform",
  4102.         xmFormWidgetClass, toplevel,
  4103.         NULL);
  4104.  
  4105.     for (i = 0; i < XtNumber(prompts); i++) {
  4106.         subform = XtVaCreateWidget("subform",
  4107.             xmFormWidgetClass,   mainform,
  4108.             /* first one should be attached for form */
  4109.             XmNtopAttachment,    i? XmATTACH_WIDGET : XmATTACH_FORM,
  4110.             /* others are attached to the previous subform */
  4111.             XmNtopWidget,        subform,
  4112.             XmNleftAttachment,   XmATTACH_FORM,
  4113.             XmNrightAttachment,  XmATTACH_FORM,
  4114.             NULL);
  4115.         label = XtVaCreateManagedWidget(prompts[i],
  4116.             xmLabelGadgetClass,  subform,
  4117.             XmNtopAttachment,    XmATTACH_FORM,
  4118.             XmNbottomAttachment, XmATTACH_FORM,
  4119.             XmNleftAttachment,   XmATTACH_FORM,
  4120.             XmNalignment,        XmALIGNMENT_BEGINNING,
  4121.             NULL);
  4122.         sprintf(buf, "text_%d", i);
  4123.         text = XtVaCreateManagedWidget(buf,
  4124.             xmTextWidgetClass,   subform,
  4125.             XmNtopAttachment,    XmATTACH_FORM,
  4126.             XmNbottomAttachment, XmATTACH_FORM,
  4127.             XmNrightAttachment,  XmATTACH_FORM,
  4128.             XmNleftAttachment,   XmATTACH_WIDGET,
  4129.             XmNleftWidget,       label,
  4130.             NULL);
  4131.         XtManageChild(subform);
  4132.     }
  4133.     /* Now that all the forms are added, manage the main form */
  4134.     XtManageChild(mainform);
  4135.  
  4136.     XtRealizeWidget(toplevel);
  4137.     XtAppMainLoop(app);
  4138. }
  4139.  
  4140. If you resize horizontally it stretches the text widgets.  If you resize
  4141. vertically it leaves space under the bottom (if you don't resize, this is not
  4142. problem).
  4143.  
  4144. If you want the text widgets to be lined up on the left, as in
  4145.  
  4146.           ----------------------------------------
  4147.          |                    ------------------- |
  4148.          |          a label  |Some text          ||
  4149.          |                    ------------------- |
  4150.                               ------------------- |
  4151.          |   a longer label  |Some more text     ||
  4152.          |                    ------------------- |
  4153.          |                    ------------------- |
  4154.          |a very long label  |Even more text     ||
  4155.          |                    ------------------- |
  4156.           ----------------------------------------
  4157.  
  4158. try this
  4159.  
  4160. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  4161.  * This program is freely distributable without licensing fees and
  4162.  * is provided without guarantee or warranty expressed or implied.
  4163.  * This program is -not- in the public domain.  This program is
  4164.  * taken from the Motif Programming Manual, O'Reilly Volume 6.
  4165.  */
  4166.  
  4167. /* text_entry.c -- This demo shows how the RowColumn widget can be
  4168.  * configured to build a text entry form.  It displays a table of
  4169.  * right-justified Labels and Text widgets that extend to the right
  4170.  * edge of the Form.
  4171.  */
  4172. #include <Xm/LabelG.h>
  4173. #include <Xm/RowColumn.h>
  4174. #include <Xm/Text.h>
  4175.  
  4176. char *text_labels[] = {
  4177.     "Name:", "Phone:", "Address:", "City:", "State:", "Zip:",
  4178. };
  4179.  
  4180. main(argc, argv)
  4181. int argc;
  4182. char *argv[];
  4183. {
  4184.     Widget toplevel, rowcol;
  4185.     XtAppContext app;
  4186.     char buf[8];
  4187.     int i;
  4188.  
  4189.     toplevel = XtVaAppInitialize(&app, "Demos", NULL, 0,
  4190.         &argc, argv, NULL, NULL);
  4191.  
  4192.     rowcol = XtVaCreateWidget("rowcolumn",
  4193.         xmRowColumnWidgetClass, toplevel,
  4194.         XmNpacking,        XmPACK_COLUMN,
  4195.         XmNnumColumns,     XtNumber(text_labels),
  4196.         XmNorientation,    XmHORIZONTAL,
  4197.         XmNisAligned,      True,
  4198.         XmNentryAlignment, XmALIGNMENT_END,
  4199.         NULL);
  4200.  
  4201.     /* simply loop thru the strings creating a widget for each one */
  4202.     for (i = 0; i < XtNumber(text_labels); i++) {
  4203.         XtVaCreateManagedWidget(text_labels[i],
  4204.             xmLabelGadgetClass, rowcol,
  4205.             NULL);
  4206.         sprintf(buf, "text_%d", i);
  4207.         XtVaCreateManagedWidget(buf,
  4208.             xmTextWidgetClass, rowcol,
  4209.             NULL);
  4210.     }
  4211.  
  4212.     XtManageChild(rowcol);
  4213.     XtRealizeWidget(toplevel);
  4214.     XtAppMainLoop(app);
  4215. }
  4216.  
  4217. This makes all objects exactly the same size.  It does not resize in nice
  4218. ways.
  4219.  
  4220. If you want the text widgets lined up on the left, and the labels to be the
  4221. size of the longest string, resizing nicely both horizontally and vertically,
  4222. as in
  4223.  
  4224.          -------------------------------------
  4225.         |                    ---------------- |
  4226.         |          a label  |Some text       ||
  4227.         |                    ---------------- |
  4228.                              ---------------- |
  4229.         |   a longer label  |Some more text  ||
  4230.         |                    ---------------- |
  4231.         |                    ---------------- |
  4232.         |a very long label  |Even more text  ||
  4233.         |                    ---------------- |
  4234.          -------------------------------------
  4235.  
  4236.  
  4237. Answer: Do this: to get the widgets lined up horizontally, use a form but
  4238. place the widgets using XmATTACH_POSITION.  In the example, attach the top of
  4239. the first label to the form, the bottomPosition to 33 (33% of the height).
  4240. Attach the topPosition of the second label to 33 and the bottomPosition to 66.
  4241. Attach the topPosition of the third label to 66 and the bottom of the label to
  4242. the form.  Do the same with the text widgets.
  4243.  
  4244. To get the label widgets lined up vertically, use the right attachment of
  4245. XmATTACH_OPPOSITE_WIDGET: starting from the one with the longest label, attach
  4246. widgets on the right to each other. In the example, attach the 2nd label to
  4247. the third, and the first to the second.  To get the text widgets lined up,
  4248. just attach them on the left to the labels.  To get the text in the labels
  4249. aligned correctly, use XmALIGNMENT_END for the XmNalignment resource.
  4250.  
  4251.         /* geometry for label 2
  4252.         */
  4253.         n = 0;
  4254.         XtSetArg (args[n], XmNalignment, XmALIGNMENT_END); n++;
  4255.         XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++;
  4256.         XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
  4257.         XtSetArg (args[n], XmNtopAttachment, XmATTACH_POSITION); n++;
  4258.         XtSetArg (args[n], XmNtopPosition, 66); n++;
  4259.         XtSetValues (label[2], args, n);
  4260.  
  4261.         /* geometry for label 1
  4262.         */
  4263.         n = 0;
  4264.         XtSetArg (args[n], XmNalignment, XmALIGNMENT_END); n++;
  4265.         XtSetArg (args[n], XmNbottomAttachment, XmATTACH_POSITION); n++;
  4266.         XtSetArg (args[n], XmNbottomPosition, 66); n++;
  4267.         XtSetArg (args[n], XmNtopAttachment, XmATTACH_POSITION); n++;
  4268.         XtSetArg (args[n], XmNtopPosition, 33); n++;
  4269.         XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++;
  4270.         XtSetArg (args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
  4271.         XtSetArg (args[n], XmNrightWidget, label[2]); n++;
  4272.         XtSetValues (label[1], args, n);
  4273.  
  4274.         /* geometry for label 0
  4275.         */
  4276.         n = 0;
  4277.         XtSetArg (args[n], XmNalignment, XmALIGNMENT_END); n++;
  4278.         XtSetArg (args[n], XmNbottomAttachment, XmATTACH_POSITION); n++;
  4279.         XtSetArg (args[n], XmNbottomPosition, 33); n++;
  4280.         XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++;
  4281.         XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++;
  4282.         XtSetArg (args[n], XmNrightAttachment, XmATTACH_OPPOSITE_WIDGET); n++;
  4283.         XtSetArg (args[n], XmNrightWidget, label[1]); n++;
  4284.         XtSetValues (label[0], args, n);
  4285.  
  4286.         /* geometry for text 0
  4287.         */
  4288.         n = 0;
  4289.         XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++;
  4290.         XtSetArg (args[n], XmNbottomAttachment, XmATTACH_POSITION); n++;
  4291.         XtSetArg (args[n], XmNbottomPosition, 33); n++;
  4292.         XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++;
  4293.         XtSetArg (args[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
  4294.         XtSetArg (args[n], XmNleftWidget, label[0]); n++;
  4295.         XtSetValues (text[0], args, n);
  4296.  
  4297.         /* geometry for text 1
  4298.         */
  4299.         XtSetArg (args[n], XmNtopAttachment, XmATTACH_POSITION); n++;
  4300.         XtSetArg (args[n], XmNtopPosition, 33); n++;
  4301.         XtSetArg (args[n], XmNbottomAttachment, XmATTACH_POSITION); n++;
  4302.         XtSetArg (args[n], XmNbottomPosition, 66); n++;
  4303.         XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++;
  4304.         XtSetArg (args[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
  4305.         XtSetArg (args[n], XmNleftWidget, label[1]); n++;
  4306.         XtSetValues (text[1], args, n);
  4307.  
  4308.         /* geometry for text 2
  4309.         */
  4310.         XtSetArg (args[n], XmNtopAttachment, XmATTACH_POSITION); n++;
  4311.         XtSetArg (args[n], XmNtopPosition, 66); n++;
  4312.         XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++;
  4313.         XtSetArg (args[n], XmNleftAttachment, XmATTACH_WIDGET); n++;
  4314.         XtSetArg (args[n], XmNleftWidget, label[2]); n++;
  4315.         XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++;
  4316.         XtSetValues (text[2], args, n);
  4317.  
  4318.  
  4319. -----------------------------------------------------------------------------
  4320. Subject: 96)  TOPIC: PUSHBUTTON WIDGET
  4321.  
  4322. -----------------------------------------------------------------------------
  4323. Subject: 97)  Why can't I use accelerators on buttons not in a menu?
  4324.  
  4325. [Last modified: Sept 94]
  4326.  
  4327. Answer:
  4328.  
  4329. It is apparently a difficult feature to implement, but OSF are considering
  4330. this for the future. It is problematic trying to use the Xt accelerators since
  4331. the Motif method interferes with this.  one workaround suggested is to
  4332. duplicate your non-menu button by a button in a menu somewhere, which does
  4333. have a menu-accelerator installed.  When the user invokes what they think is
  4334. the accelerator for the button they can see Motif actually invokes the button
  4335. on the menu that they can't see at the time. Another method is described below
  4336. and was contributed by Harald Albrecht of Institute of Geometry and Practical
  4337. Mathematics Rhine Westphalia Technical University Aachen (RWTH Aachen),
  4338. Germany
  4339.  
  4340.  
  4341. From albrecht@igpm.rwth-aachen.de Thu Jul  8 11:44:21 1993
  4342.  
  4343. NOTE: Pointers to a more recent solution by the same author follow this code
  4344. sample.
  4345.  
  4346. My work-around of this problem looks like this: (I've written that code for a
  4347. Motif Object Library in C++ so please forgive me for being object orientated!)
  4348. The hack consists of a rewritten message loop which checks for keypresses
  4349. <MAlt>+<key>. If MessageLoop() finds such a keypress HandleAcc() ist called
  4350. and the widget tree is searched for a suitable widget with the right mnemonic.
  4351.  
  4352.  
  4353. // --------------------------------------------------------------------------
  4354. // traverse the widget tree starting with the given widget.
  4355. //
  4356. BOOL TraverseWidgetTree(Widget w, char *pMnemonic, XKeyEvent *KeyEvent)
  4357. {
  4358.     Widget               wChild;
  4359.     WidgetList           ChildList;
  4360.     int                  NumChilds, Child;
  4361.     KeySym               LabelMnemonic;
  4362.     char                 *pMnemonicString;
  4363.  
  4364. // Check if the widget is a subclass of label -- then it may have an
  4365. // accelerator attached...
  4366.     if ( XtIsSubclass(w, xmLabelWidgetClass) ) {
  4367. // ok. Now: get the widget's mnemonic, convert it to ASCII and compare
  4368. // it with the Key we're looking for.
  4369.         XtVaGetValues(w, XmNmnemonic, &LabelMnemonic, NULL);
  4370.         pMnemonicString = XKeysymToString(LabelMnemonic);
  4371.         if ( pMnemonicString &&
  4372.              (strcasecmp(pMnemonicString, pMnemonic) == 0) ) {
  4373.             // stimulate the keypress
  4374.             XmProcessTraversal((Widget)w, XmTRAVERSE_CURRENT);
  4375.             KeyEvent->type      = KeyPress;
  4376.             KeyEvent->window    = XtWindow(w);
  4377.             KeyEvent->subwindow = XtWindow(w);
  4378.             KeyEvent->state     = 0;
  4379.             KeyEvent->keycode   =
  4380.                 XKeysymToKeycode(XtDisplay(w), XK_space);
  4381.             XSendEvent(XtDisplay(w), XtWindow(w),
  4382.                        True,
  4383.                        ButtonPressMask, (XEvent*) KeyEvent);
  4384.             KeyEvent->type      = KeyRelease;
  4385.             XSendEvent(XtDisplay(w), XtWindow(w),
  4386.                        True,
  4387.                        ButtonReleaseMask, (XEvent*) KeyEvent);
  4388.             return True;
  4389.         }
  4390.     }
  4391. // if this widget is a subclass of Composite check all the widget's
  4392. // childs.
  4393.     if ( XtIsSubclass(w, compositeWidgetClass) ) {
  4394. // if we're in a menu (or something like that) forget this leaf of the
  4395. // widget tree!
  4396.         if ( XtIsSubclass(w, xmRowColumnWidgetClass) ) {
  4397.             unsigned char RowColumnType;
  4398.             XtVaGetValues(w, XmNrowColumnType, &RowColumnType, NULL);
  4399.             if ( RowColumnType != XmWORK_AREA ) return False;
  4400.         }
  4401.         XtVaGetValues(w, XmNchildren, &ChildList,
  4402.                          XmNnumChildren, &NumChilds, NULL);
  4403.         for ( Child = 0; Child < NumChilds; ++Child ) {
  4404.             wChild = ChildList[Child];
  4405.             if ( TraverseWidgetTree(wChild, pMnemonic, KeyEvent) )
  4406.                 return True;
  4407.         }
  4408.     }
  4409.     return False;
  4410. } // TraverseWidgetTree
  4411. // --------------------------------------------------------------------------
  4412. // handle accelerators (keypress MAlt + key)
  4413. //
  4414. #define MAX_MAPPING 10
  4415. BOOL HandleAcc(Widget w, XEvent *event)
  4416. {
  4417.            Widget         widget, OldWidget;
  4418.     static char           keybuffer[MAX_MAPPING];
  4419.            int            CharCount;
  4420.     static XComposeStatus composeStatus;
  4421.  
  4422. // convert KeyPress to ASCII
  4423.     CharCount = XLookupString((XKeyEvent*) event,
  4424.                               keybuffer, sizeof(keybuffer),
  4425.                               NULL, &composeStatus);
  4426.     keybuffer[CharCount] = 0;
  4427. // Only one char is alright -- then search the widget tree for a widget
  4428. // with the right mnemonic
  4429.     if ( CharCount == 1 ) {
  4430.         keybuffer[0] = tolower(keybuffer[0]);
  4431.         widget = w;
  4432.         while ( (widget != NULL) &&
  4433.                 !XtIsSubclass(widget, shellWidgetClass) ) {
  4434.             OldWidget = widget; widget = XtParent(widget);
  4435.         }
  4436.         if ( !widget ) widget = OldWidget;
  4437.         return TraverseWidgetTree(widget,
  4438.                                   keybuffer, (XKeyEvent*) event);
  4439.     }
  4440.     return False; // no-one found.
  4441. } // HandleAcc
  4442. // --------------------------------------------------------------------------
  4443. // modified message loop
  4444. // loops until the Boolean pFlag points to is set to False
  4445. void MessageLoop(Boolean *pFlag)
  4446. {
  4447.     XEvent nextEvent;
  4448.  
  4449.     while ( *pFlag ) {
  4450.         if ( XtAppPending(AppContext) ) {
  4451.             XtAppNextEvent(AppContext, &nextEvent);
  4452.             if ( nextEvent.type == KeyPress ) {
  4453. // Falls es ein Tastendruck ist, bei dem auch noch die ALT-Taste
  4454. // (=Modifier 1) gedrueckt ist, koennte es ein Accelerator sein!
  4455.                 if ( nextEvent.xkey.state & Mod1Mask )
  4456.                     if ( HandleAcc(XtWindowToWidget(nextEvent.xkey.display,
  4457.                                                     nextEvent.xkey.window),
  4458.                                    &nextEvent) )
  4459.                         continue; // Mitteilung konnte ausgeliefert werden
  4460.                                   // und darf daher nicht den ueblichen
  4461.                                   // Weg gehen!
  4462.             }
  4463.             XtDispatchEvent(&nextEvent);
  4464.         }
  4465.     }
  4466. } // TApplication::MessageLoop
  4467.  
  4468.  
  4469. Harald Albrecht albrecht@igpm.rwth-aachen.de Institute of Geometry and
  4470. Practical Mathematics Rhine Westphalia Technical University Aachen (RWTH
  4471. Aachen), Germany
  4472.  
  4473. NOTE: Harald Albrecht has re-designed his solution so that you can assign
  4474. hotkeys to *every* widget by placing a label near that widget. Get the code
  4475. from:
  4476.  
  4477.   ftp.informatik.rwth-aachen.de (137.226.112.172)
  4478.   in: /pub/packages/Mnemonic/Mnemonic.tar.gz
  4479.  
  4480. or from the WWW:
  4481.  
  4482.    file://134.130.161.30/arc/pub/unix/html/motifcorner.html
  4483.  
  4484. -----------------------------------------------------------------------------
  4485. Subject: 98)  TOPIC: ICON WIDGET
  4486.  
  4487. -----------------------------------------------------------------------------
  4488. Subject: 99)  How can I add multi-colored icons to my application?
  4489.  
  4490. [Last modified: Sept 94]
  4491.  
  4492. Answer: Get the Xpm (X PixMap file format) widgets.  There is a tutorial in
  4493. the directory ftp.x.org:/contrib/docs/xpm_tut and source code in the directory
  4494. ftp.x.org:/contrib/libraries.  Documentation is part of the tar file found in
  4495. /contrib/libraries.  The /contrib/libraries directory also contains xpm.FAQ.
  4496.  
  4497. There is also a mailing list: xpm-talk@sophia.inria.fr.
  4498.  
  4499. -----------------------------------------------------------------------------
  4500. Subject: 100)  How can I convert a Sun/GIF/TIFF image to a pixmap?
  4501.  
  4502. [Last modified: Oct 94]
  4503.  
  4504. Answer: An application called "xv" (interactive image display for the X Window
  4505. System) is useful for displaying and converting many image formats. From the
  4506. man page:
  4507.  
  4508.      xv is an X11 program that displays images in the GIF,  JPEG,
  4509.      TIFF,  PBM, PGM, PPM, X11 bitmap, PDS/VICAR, Sun Rasterfile,
  4510.      and PM formats on 1-, 2-, 4-, 6-, 8-, 16-, 24-, and 32-bit X
  4511.      displays.   xv  will also read compress-ed versions of these
  4512.      files.
  4513.  
  4514. You can get "xv" (shareware by John Bradley et al) from:
  4515.  
  4516.         ftp://ftp.cis.upenn.edu/pub/xv
  4517. or:
  4518.         ftp://ftp.x.org/R5contrib/xv-3.01.tar.gz
  4519.  
  4520. Another useful conversion package is "pbm" (portable bitmap file format) by
  4521. Jef Poskanzer et al, available from:
  4522.  
  4523.         ftp://ftp.x.org/R5contrib/netpbm-1mar1994.tar.gz
  4524. or:
  4525.         ftp://ftp.x.org/R5contrib/pbmplus10dec91.tar.Z (much older :-)
  4526.  
  4527. You might also want to check the X11 FAQ for additional conversion options:
  4528.  
  4529.         ftp://ftp.x.org/contrib/faqs/FAQ
  4530.  
  4531. -----------------------------------------------------------------------------
  4532. Subject: 101)+ TOPIC: SCALE WIDGET
  4533.  
  4534. -----------------------------------------------------------------------------
  4535. Subject: 102)+ Can the XmScale widget have arrows or tick marks in Motif 2.0?
  4536.  
  4537. Answer: Daniel Dardailler (daniel@x.org) (http://www.x.org/people/daniel)
  4538. writes:
  4539.  
  4540. In 2.0, Scale gets arrows (on both sides or same side), thermometer look,
  4541. thumb slider option, tick marks, and editable resource. For a picture, see:
  4542.  
  4543.     http://www.osf.org:8001:/motif/Motif20.html
  4544.  
  4545. -----------------------------------------------------------------------------
  4546. Subject: 103)  TOPIC: LABEL WIDGET
  4547.  
  4548. -----------------------------------------------------------------------------
  4549. Subject: 104)  How can I align the text in a label (button, etc) widget?
  4550.  
  4551. Answer: The alignment for the label widget is controlled by the resource
  4552. XmNalignment, and the default centers the text. Use this resource to change it
  4553. to left or right alignment.  However, when the label (or any descendant) is in
  4554. a row column, and XmNisAligned is True (the default), the row column aligns
  4555. text using its resource XmNentryAlignment. If you want simultaneous control
  4556. over all widgets use this, but otherwise turn XmNisAligned off and do it
  4557. individually.
  4558.  
  4559.  
  4560. -----------------------------------------------------------------------------
  4561. Subject: 105)  Why doesn't label alignment work in a RowColumn?
  4562.  
  4563. Answer: RowColumn has a  resource XmNisAligned (default True) and and
  4564. XmNentryAlignment (default XmALIGNMENT_BEGINNING).  These control alignment of
  4565. the labelString in Labels and descendants. Set XmNisAligned to False to turn
  4566. this off.
  4567.  
  4568. -----------------------------------------------------------------------------
  4569. Subject: 106)* How can I set a multiline label?
  4570.  
  4571. [Last modified: Feb 95]
  4572.  
  4573. Answer: In .Xdefaults
  4574.  
  4575.       *XmLabel*labelString:             Here\nis\nthe\nLabel
  4576.  
  4577. This method does not seem to work in some of the older Motif 1.0 versions.
  4578.  
  4579. In code,
  4580.  
  4581.       char buf[128];
  4582.       XmString msg;
  4583.       sprintf(buf, "Here\nis\nthe\nLabel");
  4584.       msg = XmStringCreateLtoR(buf, XmSTRING_DEFAULT_CHARSET);
  4585.       XtSetArg (args[n], XmNlabelString, msg);
  4586.  
  4587. Gives a four line label, using the escape sequence \n for a newline.  Here's
  4588. another approach from Jean-Philippe Martin-Flatin <syj@ecmwf.co.uk>
  4589.  
  4590. #include <Xm/Xm.h>
  4591. #include <string.h>
  4592.  
  4593. /*-----------------------------------------------------
  4594.     Create a new XmString from a char*
  4595.  
  4596.     This function can deal with embedded 'newline' and
  4597.     is equivalent to XmStringCreateLtoR,
  4598.     except it does not use non AES compliant charset
  4599.     XmSTRING_DEFAULT_CHARSET
  4600. ----------------------------------------------------*/
  4601. XmString xec_NewString(char *s)
  4602. {
  4603.     XmString xms1;
  4604.     XmString xms2;
  4605.     XmString line;
  4606.     XmString separator;
  4607.     char     *p;
  4608.     char     *t = XtNewString(s);   /* Make a copy for strtok not to */
  4609.                                     /* damage the original string    */
  4610.  
  4611.  
  4612.     separator = XmStringSeparatorCreate();
  4613.     p         = strtok(t,"\n");
  4614.     xms1      = XmStringCreateLocalized(p);
  4615.  
  4616.     while (p = strtok(NULL,"\n"))
  4617.     {
  4618.         line = XmStringCreateLocalized(p);
  4619.         xms2 = XmStringConcat(xms1,separator);
  4620.         XmStringFree(xms1);
  4621.         xms1 = XmStringConcat(xms2,line);
  4622.         XmStringFree(xms2);
  4623.         XmStringFree(line);
  4624.     }
  4625.  
  4626.     XmStringFree(separator);
  4627.     XtFree(t);
  4628.     return xms1;
  4629. }
  4630.  
  4631.  
  4632. Do not use XmStringCreateLocalized() - it does not process the newline
  4633. character in the way you want. [TBD - Does anyone know if this statement is
  4634. true? Originally, this was in reference to the obsolete XmStringCreateSimple
  4635. function....ksall@cen.com]
  4636.  
  4637. -----------------------------------------------------------------------------
  4638. Subject: 107)  How can I have a vertical label?
  4639.  
  4640. Answer: Make a multiline label with one character per line, as in the last
  4641. question. There is no way to make the text rotated by 90 degrees though.
  4642.  
  4643.  
  4644. -----------------------------------------------------------------------------
  4645. Subject: 108)  How can I have a Pixmap in a Label?
  4646.  
  4647. Answer: From Bob Hays (bobhays@spss.com)
  4648.  
  4649.  
  4650.     Pixmap px_disarm, px_disarm_insens;
  4651.  
  4652.     Widget Label1;
  4653.     Pixel   foreground, background;
  4654.     Arg     args[4];
  4655.     Arg     arg[] = {
  4656.                 { XmNforeground, &foreground },
  4657.                 { XmNbackground, &background }
  4658.     };
  4659.  
  4660.     Label1 = XmCreateLabel ( Shell1, "Label1",
  4661.                                        (Arg *) NULL, (Cardinal) 0 );
  4662.     XtGetValues ( Label1, arg, XtNumber ( arg ) );
  4663.     px_disarm =
  4664.       XCreatePixmapFromBitmapData(display,
  4665.                                 DefaultRootWindow(display),
  4666.                                 mtn_bits, mtn_width, mtn_height,
  4667.                                 foreground,
  4668.                                 background,
  4669.                                 DefaultDepth(display,DefaultScreen(display)));
  4670.     px_disarm_insens =
  4671.       XCreatePixmapFromBitmapData(display,
  4672.                                 DefaultRootWindow(display),
  4673.                                 mtn_ins_bits, mtn_ins_width, mtn_ins_height,
  4674.                                 foreground,
  4675.                                 background,
  4676.                                 DefaultDepth(display,DefaultScreen(display)));
  4677.  
  4678.     n = 0;
  4679.     XtSetArg(args[n], XmNlabelType, XmPIXMAP);  n++;
  4680.     XtSetArg(args[n], XmNlabelPixmap, px_disarm);  n++;
  4681.     XtSetArg(args[n], XmNlabelInsensitivePixmap, px_disarm_insens ); n++;
  4682.     XtSetValues ( Label1, args, n );
  4683.     XtManageChild(Label1);
  4684.  
  4685. That will cause the foreground and background of your pixmap to be inherited
  4686. from the one that would be used by OSF/Motif when the label is displayed.  The
  4687. advantage is that this will utilize any resource values the user may have
  4688. requested without looking explicitly into the resource database.  And, you
  4689. will have a pixmap handy if the application insensitizes the label (without an
  4690. XmNlabelInsensitivePixmap your label will go empty if made insensitive).
  4691.  
  4692. [Bob's original code was for a PushButton. Just change all Label to PushButton
  4693. for them.]
  4694.  
  4695. -----------------------------------------------------------------------------
  4696. END OF PART THREE
  4697. Archive-name: motif-faq/part4
  4698. Last-modified: FEB 11, 1995
  4699. Posting-Frequency: monthly
  4700. Organization: Century Computing, Inc.
  4701. Version: 4.1
  4702.  
  4703.  
  4704.  
  4705. -----------------------------------------------------------------------------
  4706. Subject: 109)  TOPIC: DRAWING AREA WIDGET
  4707.  
  4708. -----------------------------------------------------------------------------
  4709. Subject: 110)  How can I send an expose event to a Drawing Area widget?  (or
  4710. any other, come to that). I want to send an expose event so that it will
  4711. redraw itself.
  4712.  
  4713. Answer: Use the Xlib call
  4714.  
  4715.         XClearArea(XtDisplay(w), XtWindow(w), 0, 0, 0, 0, True)
  4716.  
  4717. This clears the widget's window and generates an expose event in doing so.
  4718. The widgets expose action will then redraw it.  This uses a round trip
  4719. request.  An alternative, without the round trip is
  4720.  
  4721. from orca!mesa!rthomson@uunet.uu.net  (Rich Thomson):
  4722.  
  4723.     Widget da;
  4724.     XmDrawingAreaCallbackStruct da_struct;
  4725.  
  4726.     da_struct.reason = XmCR_EXPOSE;
  4727.     da_struct.event = (XEvent *) NULL;
  4728.     da_struct.window = XtWindow(da);
  4729.  
  4730.     XtCallCallbacks(da, XmNexposeCallback, (XtPointer) da_struct);
  4731.  
  4732.  
  4733. -----------------------------------------------------------------------------
  4734. Subject: 111)  How can I know when a DrawingArea has been resized?  It
  4735. generates an expose event whn it is enlarged, but not when it is shrunk.
  4736.  
  4737. Answer: Use the resize callback.
  4738.  
  4739. -----------------------------------------------------------------------------
  4740. Subject: 112)  TOPIC: MENUS
  4741.  
  4742. -----------------------------------------------------------------------------
  4743. Subject: 113)  How do I set the current choice in a radio box or an option
  4744. menu?
  4745.  
  4746. [Last modified: Sept 94]
  4747.  
  4748. Answer: Set the XmNmenuHistory resource on its RowColumn parent.
  4749.  
  4750. Thanks to Ken Lee, kenton@esd.sgi.com
  4751.  
  4752. -----------------------------------------------------------------------------
  4753. Subject: 114)  How do I make a menu choice insensitive if it was created with
  4754. XmVaCreateSimplePulldownMenu?
  4755.  
  4756. [Last modified: Sept 94]
  4757.  
  4758. Answer: According to the Motif manual, the buttons are named "button_n", where
  4759. "n" is an integer starting from 0.  You can use XtNameToWidget() to convert
  4760. these names to widget ID's.
  4761.  
  4762. Thanks to Ken Lee, kenton@esd.sgi.com
  4763.  
  4764. -----------------------------------------------------------------------------
  4765. Subject: 115)  What can I put inside a menu bar?
  4766.  
  4767. Answer: You can only put cascade buttons in menu bars. No pushbuttons, toggle
  4768. buttons or gadgets are allowed. When you create a pulldown menu with parent a
  4769. menu bar, its real parent is a shell widget.
  4770.  
  4771. -----------------------------------------------------------------------------
  4772. Subject: 116)  Can I have a cascade button without a submenu in a pulldown
  4773. menu?
  4774.  
  4775. Answer: Yes you can. A cascade button has an activate callback which is called
  4776. when you click on it and it doesn't have a submenu. It can have a mnemonic,
  4777. but keyboard traversal using the arrow keys in the menu will skip over it.
  4778.  
  4779. -----------------------------------------------------------------------------
  4780. Subject: 117)  Should I have a cascade button without a submenu in a pulldown
  4781. menu?
  4782.  
  4783. Answer: No. This is forbidden by the style guide. Technically you can do it
  4784. (see previous question) but if you do it will not be Motif style compliant.
  4785. This is unlikely to change - if a "button" is important enough to be in a
  4786. pulldown menu bar with no pulldown, it should be a button elsewhere.  (Mind
  4787. you, you won't be able to put accelerators on it elsewhere though.)
  4788.  
  4789. -----------------------------------------------------------------------------
  4790. Subject: 118)  What is the best way to create popup menus?
  4791.  
  4792. [Last modified: August 92]
  4793.  
  4794. Susan Murdock Thompson (from OSF): In general, create a popupMenu as the child
  4795. from which you will be posting it from (ie: if you have a bulletinBoard with a
  4796. PushButton in it and want MB2 on the pushButton to post the popupMenu, create
  4797. the popupMenu as a child of the pushButton).  [This parent-child relationship
  4798. seems to make a big difference in the behavior of the popups.]  Add an event
  4799. handler to handle buttonPress events.  You'll need to check for the correct
  4800. button (what you've specified menuPost to be) before posting the menu.
  4801.  
  4802. To create a popup that can be accessible from within an entire client window,
  4803. create it as the child of the top-most widget (but not the shell) and add
  4804. event handlers for the top-most widget and children widgets.
  4805.  
  4806. ie:
  4807.  
  4808. {
  4809.   ....
  4810.  
  4811.   XtManageChild(rc=XmCreateRowColumn(Shell1, "rc", NULL, 0));
  4812.   XtManageChild(label = XmCreateLabel(rc, "label", NULL, 0));
  4813.   XtManageChild(text = XmCreateText(rc, "text", NULL, 0));
  4814.   XtManageChild(pushbutton = XmCreatePushButton(rc, "pushbutton", NULL, 0));
  4815.  
  4816.   n = 0;
  4817.   XtSetArg(args[n], XmNmenuPost, "<Btn3Down>"); n++;
  4818.   popup = XmCreatePopupMenu(rc, "popup", args, n);
  4819.  
  4820.   XtAddEventHandler(rc, ButtonPressMask, False, PostMenu3, popup);
  4821.   XtAddEventHandler(text, ButtonPressMask, False, PostMenu3, popup);
  4822.   XtAddEventHandler(label, ButtonPressMask, False, PostMenu3, popup);
  4823.   XtAddEventHandler(pushbutton, ButtonPressMask, False, PostMenu3, popup);
  4824.  
  4825.   XtManageChild(m1 = XmCreatePushButton(popup, "m1", NULL, 0));
  4826.   XtManageChild(m2 = XmCreatePushButton(popup, "m2", NULL, 0));
  4827.   XtManageChild(m3 = XmCreatePushButton(popup, "m3", NULL, 0));
  4828.  
  4829.   XtAddCallback(m1, XmNactivateCallback, SayCB, "button M1");
  4830.   XtAddCallback(m2, XmNactivateCallback, SayCB, "button M2");
  4831.   XtAddCallback(m3, XmNactivateCallback, SayCB, "button M3");
  4832.   ...
  4833. }
  4834.  
  4835. /* where PostMenu3 is ... */
  4836.  
  4837. PostMenu3 (w, popup, event)
  4838. Widget w;
  4839. Widget popup;
  4840. XButtonEvent * event;
  4841. {
  4842.   printf("menuPost = 3, button %d0, event->button);
  4843.  
  4844.   if (event->button != Button3)
  4845.     return;
  4846.   XmMenuPosition(popup, event);
  4847.   XtManageChild(popup);
  4848. }
  4849.  
  4850.  
  4851. -----------------------------------------------------------------------------
  4852. Subject: 119)  How do popup menus work?
  4853.  
  4854. [Last modified: August 92]
  4855.  
  4856. Answer:
  4857.  
  4858. When a popup menu is created as the child of a widget the menu system installs
  4859. a translation on the parent of the popup and descendants with an action which:
  4860. (1) when 3-rd button (the default for the menuPost resource) is pressed the
  4861. cursor changes and the mouse is grabbed for 5 seconds; (2) disables event
  4862. handlers on the descendants and the handlers are never called; (3) an event
  4863. handler installed on the parent works fine.
  4864.  
  4865. It is done so that the correct event handler will (in fact) be called.  There
  4866. is a grab with owner_events true.  The grab is released by a timer,  but
  4867. normally the posted menu shell puts up it's own grab.
  4868.  
  4869. If you only have widgets then you can use the subwindow field in the event to
  4870. identify the original widget.  If you have gadgets or other data that you want
  4871. to change the menu for (or use a specific menu for) then you must do a walk of
  4872. the parent's children to find the best match.
  4873.  
  4874. One thing to beware of is that even with the grab,  because the menu system
  4875. does a grab with owner events true, you must either have an event handler, or
  4876. nothing that will use the event on each widget in the hierarchy of the menu's
  4877. parent.  If a child widget has another event handler for button down, it may
  4878. swallow the event and do something else.
  4879.  
  4880. -----------------------------------------------------------------------------
  4881. Subject: 120)  Should I use translation tables or actions for popup menus?
  4882.  
  4883. [Last modified: August 92]
  4884.  
  4885. Answer: The original goal of popupMenus was that the user would not have to
  4886. specify an event handler to manage popupMenus; however, that did not become
  4887. reality.  Larry Rogers wrote:
  4888.  
  4889. > There appear to be two ways to manage popup menus.  I
  4890. > am curious what the correct way would be:
  4891.  
  4892. > 1.  Change the translation table of the widget with the
  4893. >    popup child to popup the menu.  Note that this does
  4894. >    not currently working for many widgets, because aug-
  4895. >    menting their translations, even for augment breaks
  4896. >    the widget.
  4897.  
  4898. > 2.  Add an event handler at creation to the widget; then
  4899. >    determine if the event that caused the event handler
  4900. >    to be called is the current button being used by the
  4901. >    menu as its activation button.
  4902.  
  4903. Susan Murdock Thompson (from OSF) replied: *Theoretically, you should be able
  4904. to do both.*  Our documentation says use event handlers.  Our tests for the
  4905. toolkit use event handlers and for UIL use translations.  (Although I tried an
  4906. event handler with a UIL test and it works).
  4907.  
  4908. -----------------------------------------------------------------------------
  4909. Subject: 121)  What are the known bugs in popup menus?
  4910. [Last modified: August 92]
  4911.  
  4912. Answer: As at Motif 1.1.4, the bugs for which an OSF PIR exists are:
  4913.  
  4914.    (3)  Menus not being sticky (ie: posted on a Btn CLICK)  [ Note:this
  4915.         problem occurs with OptionMenus as well]  (PIR 3435)
  4916.  
  4917.    (6)  Destroying a widget with an associated popupMenu results in
  4918.         "Warning: Attempt to remove non-existant passive grab"         (PIR
  4919. 2972)
  4920.  
  4921.    (7)  Current documentation insufficient regarding requirements for
  4922.         success in using PopupMenus.  (PIR 3433)
  4923.  
  4924.  
  4925. -----------------------------------------------------------------------------
  4926. Subject: 122)  Can I have multiple popup menus on the same widget?
  4927.  
  4928. [Last modified: August 92]
  4929.  
  4930. Answer: If you want to have several popups (activated by different mouse
  4931. buttons) on the same widget..., well, that doesn't work yet.
  4932.  
  4933. If you want to have several popups on different children... that works.  But
  4934. don't put a popup on the parent (manager) widget, or it will rule!
  4935.  
  4936.  
  4937. -----------------------------------------------------------------------------
  4938. Subject: 123)  TOPIC: INPUT FOCUS
  4939.  
  4940. -----------------------------------------------------------------------------
  4941. Subject: 124)  How can I specify the widget that should have the keyboard
  4942. focus when my application starts up?  Answer: In Motif 1.2, use
  4943. XmNinitialFocus on the manager widget.
  4944.  
  4945. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  4946.  
  4947.  
  4948. -----------------------------------------------------------------------------
  4949. Subject: 125)  How can I direct the keyboard input to a particular widget?
  4950.  
  4951. Answer: In Motif 1.1 call XmProcessTraversal(target, XmTRAVERSE_CURRENT).  The
  4952. widget (and all of its ancestors) does need to be realized BEFORE you call
  4953. this. Otherwise it has no effect.  XmProcessTraversal is reported to have many
  4954. bugs, so it may not work right.  A common occurrence is that it doesn't move
  4955. to the widget, but if you call XmProcessTraversal *twice* in a row, it will.
  4956. If you can't get it to work, try this from Kee Hinckley:
  4957.  
  4958.     // This insane sequence is as follows:
  4959.     //      On manage set up a focus callback
  4960.     //      On focus callback set up a timer (and get rid of focus callback!)
  4961.     //      On timer set the focus (which only works if the parent
  4962.     //      has the focus,
  4963.     //      which is why we went through all of this garbage)
  4964.     // There may be a better way, but I haven't time to try it now.
  4965.     //
  4966.     static void focusTO(void *data, XtIntervalId *) {
  4967.         XmProcessTraversal((Widget) data, XmTRAVERSE_CURRENT);
  4968.     }
  4969.  
  4970.     static void focusCB(Widget w, XtPointer data, XtPointer) {
  4971.         XtRemoveCallback(w, XmNfocusCallback, focusCB, data);
  4972.         XtAppAddTimeOut(XtWidgetToApplicationContext(w), 0, focusTO, data);
  4973.     }
  4974.  
  4975.     void OmXSetFocus(Widget parent, Widget w) {
  4976.         XtAddCallback(parent, XmNfocusCallback, focusCB, w);
  4977.     }
  4978.  
  4979.  
  4980. In Motif 1.0 call the undocumented _XmGrabTheFocus(target).
  4981.  
  4982. Do not use the X or Xt calls such as XtSetKeyboardFocus since this bypasses
  4983. the Motif traversal layer and can cause it to get confused.  This can lead to
  4984. odd keyboard behaviour elsewhere in your application.
  4985.  
  4986. -----------------------------------------------------------------------------
  4987. Subject: 126)* How can I have a modal dialog which has to be answered before
  4988. the application can continue?
  4989.  
  4990. [Last modified: Feb 95]
  4991.  
  4992. Answer: Note: J.-N. Meurisse (uunet!rc4.vub.ac.be!jnmeuris) sent a correction
  4993. to the following code fragment. Change:
  4994.  
  4995.         XtAddCallback(dialog, XmNpopdownCallback, ...)
  4996. to
  4997.         XtAddCallback(XtParent(dialog), XmNpopdownCallback, ...)
  4998.  
  4999. The answer depends on whether you are using the Motif window manager mwm or
  5000. not.  Test for this by XmIsMotifWMRunning.
  5001.  
  5002. The window manager mwm knows how to control event passing to dialog widgets
  5003. declared as modal. If the dialog is set to application modal, then no
  5004. interaction with the rest of the application can occur until the dialog is
  5005. destroyed or unmanaged.
  5006.  
  5007. Use the appropriate code in the following program.  There is followup
  5008. discussion after the program.
  5009.  
  5010.  
  5011. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  5012.  * This program is freely distributable without licensing fees and
  5013.  * is provided without guarantee or warranty expressed or implied.
  5014.  * This program is -not- in the public domain.  This program is
  5015.  * taken from the Motif Programming Manual, O'Reilly Volume 6.
  5016.  */
  5017.  
  5018. /*
  5019.  * ask_user.c -- create a pushbutton that posts a dialog box
  5020.  * that asks the user a question that requires an immediate
  5021.  * response.  The function that asks the question actually
  5022.  * posts the dialog that displays the question, waits for and
  5023.  * returns the result.
  5024.  */
  5025. #include <X11/Intrinsic.h>
  5026. #include <Xm/DialogS.h>
  5027. #include <Xm/SelectioB.h>
  5028. #include <Xm/RowColumn.h>
  5029. #include <Xm/MessageB.h>
  5030. #include <Xm/PushBG.h>
  5031. #include <Xm/PushB.h>
  5032.  
  5033. XtAppContext app;
  5034.  
  5035. #define YES 1
  5036. #define NO  2
  5037.  
  5038. /* main() --create a pushbutton whose callback pops up a dialog box */
  5039. main(argc, argv)
  5040. char *argv[];
  5041. int argc;
  5042. {
  5043.     Widget parent, button, toplevel;
  5044.     XmString label;
  5045.     void pushed();
  5046.  
  5047.     toplevel = XtAppInitialize(&app, "Demos",
  5048.         NULL, 0, &argc, argv, NULL, NULL, 0);
  5049.  
  5050.     label = XmStringCreateLocalized("/bin/rm *");
  5051.     button = XtVaCreateManagedWidget("button",
  5052.         xmPushButtonWidgetClass, toplevel,
  5053.         XmNlabelString,          label,
  5054.         NULL);
  5055.     XtAddCallback(button, XmNactivateCallback,
  5056.         pushed, "Remove Everything?");
  5057.     XmStringFree(label);
  5058.  
  5059.     XtRealizeWidget(toplevel);
  5060.     XtAppMainLoop(app);
  5061. }
  5062.  
  5063. /* pushed() --the callback routine for the main app's pushbutton. */
  5064. void
  5065. pushed(w, question)
  5066. Widget w;
  5067. char *question;
  5068. {
  5069.     if (AskUser(w, question) == YES)
  5070.         puts("Yes");
  5071.     else
  5072.         puts("No");
  5073. }
  5074.  
  5075. /*
  5076.  * AskUser() -- a generalized routine that asks the user a question
  5077.  * and returns the response.
  5078.  */
  5079. AskUser(parent, question)
  5080. char *question;
  5081. {
  5082.     static Widget dialog;
  5083.     XmString text, yes, no;
  5084.     static int answer;
  5085.     extern void response();
  5086.  
  5087.     answer = 0;
  5088.     if (!dialog) {
  5089.         dialog = XmCreateQuestionDialog(parent, "dialog", NULL, 0);
  5090.         yes = XmStringCreateLocalized("Yes");
  5091.         no = XmStringCreateLocalized("No");
  5092.         XtVaSetValues(dialog,
  5093.             XmNdialogStyle,        XmDIALOG_APPLICATION_MODAL,
  5094.             XmNokLabelString,      yes,
  5095.             XmNcancelLabelString,  no,
  5096.             NULL);
  5097.         XtSetSensitive(
  5098.             XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON), False);
  5099.         XtAddCallback(dialog, XmNokCallback, response, &answer);
  5100.         XtAddCallback(dialog, XmNcancelCallback, response, &answer);
  5101.         /* if the user interacts via the system menu: */
  5102. /* SEE CORRECTION ABOVE */
  5103.         XtAddCallback(dialog, XmNpopdownCallback, response, &answer);
  5104.     }
  5105.     text = XmStringCreateLocalized(question);
  5106.     XtVaSetValues(dialog,
  5107.         XmNmessageString,      text,
  5108.         NULL);
  5109.     XmStringFree(text);
  5110.     XtManageChild(dialog);
  5111.     XtPopup(XtParent(dialog), XtGrabNone);
  5112.  
  5113.     /* while the user hasn't provided an answer, simulate XtMainLoop.
  5114.      * The answer changes as soon as the user selects one of the
  5115.      * buttons and the callback routine changes its value.  Don't
  5116.      * break loop until XtPending() also returns False to assure
  5117.      * widget destruction.
  5118.      */
  5119.     while (answer == 0 || XtAppPending(app))
  5120.         XtAppProcessEvent(app, XtIMAll);
  5121.     return answer;
  5122. }
  5123.  
  5124. /* response() --The user made some sort of response to the
  5125.  * question posed in AskUser().  Set the answer (client_data)
  5126.  * accordingly and destroy the dialog.
  5127.  */
  5128. void
  5129. response(w, answer, reason)
  5130. Widget w;
  5131. int *answer;
  5132. XmAnyCallbackStruct *reason;
  5133. {
  5134.     switch (reason->reason) {
  5135.         case XmCR_OK:
  5136.             *answer = YES;
  5137.             break;
  5138.         case XmCR_CANCEL:
  5139.             *answer = NO;
  5140.             break;
  5141.         default:
  5142.             *answer = NO;
  5143.             return;
  5144.     }
  5145. }
  5146.  
  5147.  
  5148. If you aren't running a window manager that acknowledges this hint, then you
  5149. may have to grab the pointer (and keyboard) yourself to make sure the user
  5150. doesn't interact with any other widget.  Change the grab flag in XtPopup to
  5151. XtGrabExclusive, and XtRemoveGrab(XtParent(w)) to the response() function.
  5152.  
  5153.  
  5154. -----------------------------------------------------------------------------
  5155. Subject: 127)  TOPIC: MEMORY AND SPEED
  5156.  
  5157. -----------------------------------------------------------------------------
  5158. Subject: 128)  When can I free data structures passed to or retrieved from
  5159. Motif?
  5160.  
  5161. Answer:
  5162.  In most cases, especially for XmStrings and XmFontLists, Motif copies data
  5163. passed to it or retrieved from it, so it may be freed immediately.  Server-
  5164. side resources, such as pixmaps and color cells, however, are not copied, so
  5165. should not be freed.  More recent versions of Motif are better than earlier
  5166. versions and exceptions should be documented.
  5167.  
  5168. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  5169.  
  5170. -----------------------------------------------------------------------------
  5171. Subject: 129)* Why does my application grow in size?
  5172.  
  5173. [Last modified: Feb 95]
  5174.  
  5175. Answer: Motif 1.0 has many memory leaks, particularly in XmString
  5176. manipulation.  Switch to Motif 1.1. 1.2, or 2.0.
  5177.  
  5178. Answer: The Intrinsics have a memory leak in accelerator table management, and
  5179. Motif uses this heavily.  Avoid this by mapping/unmapping widgets rather than
  5180. creating/destroying them, or get  X11R4 fix-15/16/17.
  5181.  
  5182. Answer: The server may grow in size due to its own memory leaks.  Switch to a
  5183. later server.
  5184.  
  5185. Answer: You are responsible for garbage collection in `C'.  Some common cases
  5186. where a piece of memory becomes garbage are
  5187.  
  5188.  a.  Memory is allocated by Motif for XmStrings by the functions
  5189.      XmStringConcat, XmStringCopy, XmStringCreate, XmStringCreateLtoR,
  5190.      XmStringCreateLocalized, XmStringDirectionCreate, XmStringNConcat,
  5191.      XmStringNCopy, XmStringSegmentCreate, and XmStringSeparatorCreate.  The
  5192.      values returned by these functions should be freed using XmStringFree
  5193.      when they are no longer needed.
  5194.  
  5195.  b.  Memory is allocated by Motif for ordinary character strings (of type
  5196.      String) by Motif in XmStringGetLtoR, XmStringGetNextComponent, and
  5197.      XmStringGetNextSegment. After using the string, XtFree() it. [Note that
  5198.      XmStrings and Strings are two different data types.  XmStrings are
  5199.      XmStringFree'd, Strings are XtFree'd.]
  5200.  
  5201.  c.  If you have set the label (an XmString) in a label, pushbutton, etc
  5202.      widget, free it after calling XtSetValues() or the widget creation
  5203.      routine by XmStringFree().
  5204.  
  5205.  d.  If you have set text in a text widget, the text widget makes its own
  5206.      copy.  Unless you have a use for it, there is no need to keep your own
  5207.      copy.
  5208.  
  5209.  e.  If you have set the strings in a list widget the list widget makes its
  5210.      own copy.  Unless you have a use for it, there is no need to keep your
  5211.      own copy.
  5212.  
  5213.  f.  When you get the value of a single compound string from a Widget e.g.
  5214.      XmNlabelString, XmNmessageString, ... Motif gives you a copy of its
  5215.      internal value.  You should XmStringFree this when you have finished with
  5216.      it.
  5217.  
  5218.  g.  On the other hand, when you get a value of a Table e.g. XmStringTable for
  5219.      a List, you get a *pointer* to the internal Table, and should not free
  5220.      it.
  5221.  
  5222.  h.  When you get the value of the text in a widget by XmTextGetString or from
  5223.      the resource XmNvalue, you get a copy of the text.  You should XtFree
  5224.      this when you have finished with it.
  5225.  
  5226. Answer: From Josef Nelissen: at least in Motif 1.1.4, X11R4 on a HP 720, the
  5227. XmText/XmTextFieldSetString() functions have a memory leak.  The old
  5228. value/contents of the Widget isn't freed correctly.  To work around this bug,
  5229. one should use a XmText Widget (in single-line-mode) instead of a XmTextField
  5230. Widget (the solution fails with XmTextField Widgets !) and replace any
  5231.  
  5232.        XmTextSetString(text_widget, str);
  5233.  
  5234. by
  5235.  
  5236.        XmTextReplace(text_widget, (XmTextPosition) 0,
  5237.                      XmTextGetLastPosition(text_widget), str);
  5238.  
  5239.  
  5240. -----------------------------------------------------------------------------
  5241. Subject: 130)  Why does my application take a long time to start up?
  5242.  
  5243. Answer: You are probably creating too many widgets at startup time.  Delay
  5244. creating them until needed.  If you have a large number of resources in text
  5245. files (such as in app-defaults), time may be spent reading and parsing it.
  5246.  
  5247. -----------------------------------------------------------------------------
  5248. Subject: 131)  My application is running too slowly. How can I speed it up?
  5249.  
  5250. Answer: Use the R4 rather than R3 server.  It is much faster.
  5251.  
  5252. Answer: The standard memory allocator is not well tuned to Motif, and can
  5253. degrade performance.  Use a better allocator.  e.g. with SCO Unix, link with
  5254. libmalloc.a; use the allocator from GNU emacs; use the allocator from Perl.
  5255.  
  5256. Answer: Avoid lots of widget creation and destruction.  It fragments memory
  5257. and slows everything down.  Popup/popdown, manage/unmanage instead.
  5258.  
  5259. Answer: Set mappedWhenManaged to FALSE, and then call XtMapWidget()
  5260. XtUnmapWidget() rather than managing.
  5261.  
  5262. Answer: Get more memory - your application, the server and the Operating
  5263. System may be spending a lot of time being swapped.
  5264.  
  5265. Answer: If you are doing much XmString work yourself, such as heavy use of
  5266. XmStringCompare, speed may deteriorate due to the large amount of internal
  5267. conversions and malloc'ing.  Try using XmStringByteCompare if appropriate or
  5268. ordinary Ascii strings if you can.
  5269.  
  5270.  
  5271. -----------------------------------------------------------------------------
  5272. Subject: 132)  Why is my application so huge?
  5273.  
  5274. Answer: The typical size of a statically linked Motif app is in the megabytes.
  5275. This is often caused by the size of libXm.a. A large part of this gets linked
  5276. in to even trivial Motif programs. You can reduce the code size by linking
  5277. against shared libraries if they are available.  Running "strip" on the
  5278. executable can often reduce size. Note that the size of the running program
  5279. should be measured by "ps", not by the code size.
  5280.  
  5281. -----------------------------------------------------------------------------
  5282. Subject: 133)* TOPIC: XMSTRING
  5283.  
  5284. -----------------------------------------------------------------------------
  5285. Subject: 134)* What string functions differ in Motif 1.2 (compared to Motif
  5286. 1.1)? Is XmStringCreateSimple obsolete? What should I use instead?
  5287.  
  5288. [Last modified: Feb 95]
  5289.  
  5290. Answer: XmStringCreateSimple is obsolete. Use XmStringCreateLocalized instead.
  5291.  
  5292. Matthew B. Evans (Evans@EDFUA6.ctis.af.mil) writes:
  5293.  
  5294. We just upgraded from Motif 1.1 to 1.2.  When we went to compile, no problem,
  5295. but our XmStringCreateSimple() and XmStringGetLtoR() seemed to have problems.
  5296.  
  5297. As we found out, Motif 1.2 STRONGLY recommends to use the constant
  5298. XmFONTLIST_DEFAULT_TAG instead of XmSTRING_DEFAULT_CHARSET in all of the
  5299. XmStringXXX() functions, as XmSTRING_DEFAULT_CHARSET is maintained only for
  5300. compatibility (not a whole lot in my opinion).  I got this information from
  5301. Book 6B from O'Reilly.
  5302.  
  5303. You may want to take a look at this book if you can. Some XmString functions
  5304. are outdated and maintained only for compatibility, whereas some don't
  5305. function correctly when using XmSTRING_DEFAULT_CHARSET (from our in-depth
  5306. tests).
  5307.  
  5308. We have changed all our XmStringCreateSimple() to XmStringCreateLocalized()
  5309. (as suggested in book 6B) and changed all XmSTRING_DEFAULT_CHARSET to
  5310. XmFONTLIST_DEFAULT_TAG.
  5311.  
  5312. [Thanks to John West (jwest@nas.nasa.gov) for fixing a typo in the above.]
  5313.  
  5314. NOTE: All string answers in this FAQ now use XmStringCreateLocalized rather
  5315. than XmStringCreateSimple. The documentaton makes it clear that
  5316. XmStringCreateSimple is obsolete and is only kept for compatibility with Motif
  5317. 1.1. New applications should not use this function since XmStringCreateSimple
  5318. may disappear in a subsequent Motif release. (Thanks to Miguel Angel Chamochin
  5319. (mangel@tid.es) for reminding me to fix this mess.)....ksall@cen.com.
  5320.  
  5321. -----------------------------------------------------------------------------
  5322. Subject: 135)  How can I get the Ascii text out of an XmString?
  5323.  
  5324. Answer: To get the first line of text from a string created left-to-right
  5325.  
  5326.  
  5327.         char *str;
  5328.         XmString xmstr;
  5329.  
  5330.         /* stuff to create xmstr */
  5331.         ...
  5332.  
  5333.         /* set str to point to the text */
  5334.         XmStringGetLtoR(xmstr, XmSTRING_DEFAULT_CHARSET, &str);
  5335.         /* use the string */
  5336.         ...
  5337.  
  5338.         /* and reclaim space */
  5339.         XtFree(str);
  5340.  
  5341.  
  5342. -----------------------------------------------------------------------------
  5343. Subject: 136)  When can XmStrings used as resources be freed?
  5344.  
  5345. Answer: The policy OSF have been trying to enforce is that if you set an
  5346. XmString or XmStringTable resource, the application is responsible for freeing
  5347. the XmStrings used because the widget makes a copy.  If you get an XmString
  5348. resource, then the application must free the value gotten.  If you get an
  5349. XmStringTable, then the application should NOT free the value gotten.  If the
  5350. application wants to manipulate it, it should make a copy first. This policy
  5351. appears to be implemented progressively, so may be less true for Motif 1.0
  5352. than 1.1.
  5353.  
  5354. -----------------------------------------------------------------------------
  5355. Subject: 137)  Why doesn't XmStringGetNextSegment() work properly?
  5356.  
  5357. Answer: The documentation in Motif 1.0 is in error. Instead of
  5358.  
  5359.         XmStringGetnextSegment(context, ...)
  5360.         XmStringContext * context;
  5361.  
  5362. it should be
  5363.  
  5364.         XmStringGetnextSegment(context, ...)
  5365.         XmStringContext context;
  5366.  
  5367. i.e. with no indirection.
  5368.  
  5369.  
  5370. -----------------------------------------------------------------------------
  5371. Subject: 138)  Why does using XmStringDraw cause a Bad Font error?
  5372.  
  5373. [Last modified: Sept 94]
  5374.  
  5375. Answer: From Thomas Berlage (berlage@gmdzi.gmd.de): You could call this a bug
  5376. in Motif. You pass a GC to XmStringDraw, however, Motif wants to use the fonts
  5377. from the font list to draw the string.  Therefore it replaces the font of the
  5378. GC temporarily with some fonts of its own as specified in the font list. In
  5379. the end it tries to restore the old font of the GC. There comes the problem:
  5380.  
  5381. If a GC uses the default font, the client side GC structure does not have a
  5382. valid font id (that is the 0xffffffff you may see in the error message). Motif
  5383. tries to restore this invalid id at the end.
  5384.  
  5385. The workaround is: Before drawing with XmStringDraw, set the font id of the GC
  5386. to any valid font id, for example using
  5387.  
  5388.       XSetFont (display, gc, XLoadFont (display, "fixed"));
  5389.  
  5390. Another solution is available from "Harry's Motif Programming Corner", Harald
  5391. Albrecht, albrecht@igpm.rwth-aachen.de, who writes:
  5392.  
  5393. "It's somewhat longer but doesn't rely on a font named "fixed" installed on
  5394. your platform. Instead it takes a fontlist and then uses the first font listed
  5395. there. You'll find this source together with a short demo program (which
  5396. creates a DrawingArea and then paints some text in it) on:
  5397.   ftp.igpm.rwth-aachen.de (134.130.161.30)
  5398.   in: /arc/pub/unix/motif/RenderXmString.tar.gz
  5399.  
  5400. There's also a html page available:
  5401.   file://ftp.igpm.rwth-aachen.de/arc/pub/unix/html/renderxmstrings.html "
  5402.  
  5403. From Harald Albrecht (albrecht@igpm.rwth-aachen.de)
  5404.  
  5405. -----------------------------------------------------------------------------
  5406. Subject: 139)  TOPIC: DIALOGS
  5407.  
  5408. -----------------------------------------------------------------------------
  5409. Subject: 140)  How do I stop my dialog disappearing when I press the help
  5410. button?
  5411.  
  5412. Answer: Bulletin board has the resource autoUnmanage which defaults to True.
  5413. This unmanages the widget when any button child is activated - including the
  5414. help button.  Set this to False to stop it disappearing. Note that you then
  5415. have to unmanage the bulletin board yourself when any other button is
  5416. activated.
  5417.  
  5418. -----------------------------------------------------------------------------
  5419. Subject: 141)  How do I make my own dialog?  I want a dialog with my own set
  5420. of buttons that stretch and shrink like the ones in e.g. PromptDialog and its
  5421. own contents.
  5422.  
  5423. Answer: Start off with say a PromptDialog. Unmanage the buttons you don't want
  5424. or manage the Apply button if you want another. Unmanage the other bits of the
  5425. selection box you don't want. You can add another WorkArea child to the
  5426. selection box for any extra stuff you want.
  5427.  
  5428.     /* Copyright 1990, Kee Hinckley and Brian Holt Hawthorne */
  5429.     /* Permission granted for any use, provided this copyright */
  5430.     /* notice is maintained. */
  5431.  
  5432.     /* Create a dialog box */
  5433.     argcount = setArgs(&args, XmNautoUnmanage, False, NULL);
  5434.     SomeDialog = XmCreatePromptDialog(mainShell, "someDialog", args, argcount);
  5435.  
  5436.     /* Now get rid of the things we don't want */
  5437.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_SELECTION_LABEL);
  5438.     XtUnmanageChild(child);
  5439.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_TEXT);
  5440.     XtUnmanageChild(child);
  5441.  
  5442.     /* set the callbacks, and make sure the buttons we want are there */
  5443.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_OK_BUTTON);
  5444.     XtAddCallback(child, XmNactivateCallback, callSomeFunc, someArg);
  5445.     XtAddCallback(child, XmNactivateCallback, unManage, SomeDialog);
  5446.     XtManageChild(child);
  5447.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_APPLY_BUTTON);
  5448.     XtAddCallback(child, XmNactivateCallback, callSomeFunc, someOtherArg);
  5449.     XtManageChild(child);
  5450.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_CANCEL_BUTTON);
  5451.     XtAddCallback(child, XmNactivateCallback, dialogUnmanage, SomeDialog);
  5452.     XtManageChild(child);
  5453.  
  5454.     /* Add a new work area. This can be any manager. */
  5455.     child = XmCreateForm(SomeDialog, "someForm", NULL, 0);
  5456.     XtManageChild(child);
  5457.  
  5458.     /* and fill it up... */
  5459.     something = doYourStuff(child);
  5460.  
  5461. another Answer:
  5462.  
  5463.         I had a some people asking about my xmSmartMessageBoxWidget
  5464.  
  5465.         It's public domain, and needs Motif-1.2  and is available at
  5466.         ftp.x.org:/contrib/widget/SmartMB.tar.Z.
  5467.  
  5468.         The basic idea behind it is that it allows the programmer to
  5469.         specify the management of child widgets in 4 areas: Label, Control,
  5470.         Separator and Action.  You can have up to 1 Label, 1 Control,
  5471.         1 Separator and as many Action children as you want.  It does not
  5472.         REQUIRE any of these, and there is no unmanaging of extra widgets,
  5473.         as the programmer creates what is needed.
  5474.  
  5475.         Thanks for the smart dialog info to:         John L. Cwikla
  5476.         Wolfram Research, Inc.          cwikla@wri.com
  5477.  
  5478.  
  5479. -----------------------------------------------------------------------------
  5480. Subject: 142)  Why do dialog title bars have "_popup" or "<-popup"
  5481. concatenated onto the widget name?
  5482.  
  5483.  
  5484. Answer: Motif 1.0.3 (?) "fixed" things such that title bars without an
  5485. explicit dialogTitle setting use the widget name with "_popup" or whatever
  5486. added on.  Set the dialogTitle resource explicitly if you don't want this new
  5487. default naming scheme.
  5488.  
  5489. -----------------------------------------------------------------------------
  5490. Subject: 143)  How can I force a dialog window to display?
  5491.  
  5492. I manage a "working" dialog, and do some computing, but the dialog window
  5493. appears blank until the work has finished.  How can I force it to be
  5494. displayed?
  5495.  
  5496. [Last modified: Dec '94]
  5497.  
  5498. Answer: David Brooks <dbrooks@ics.com> writes: The dialog window won't get
  5499. expose events until the window manager has fielded the map request, done the
  5500. reparenting with all that entails, and finally convinced the server that the
  5501. window is for real.  The safe way of doing it is [below].
  5502.  
  5503. Use this.  (David Brooks, Systems Engineering, Open Software Foundation)
  5504.  
  5505.  
  5506. /*
  5507.  * This procedure will ensure that, if a dialog window is being mapped,
  5508.  * its contents become visible before returning.  It is intended to be
  5509.  * used just before a bout of computing that doesn't service the display.
  5510.  * You should still call XmUpdateDisplay() at intervals during this
  5511.  * computing if possible.
  5512.  *
  5513.  * The monitoring of window states is necessary because attempts to map
  5514.  * the dialog are redirected to the window manager (if there is one) and
  5515.  * this introduces a significant delay before the window is actually mapped
  5516.  * and exposed.  This code works under mwm, twm, uwm, and no-wm.  It
  5517.  * doesn't work (but doesn't hang) with olwm if the mainwindow is iconified.
  5518.  *
  5519.  * The argument to ForceDialog is any widget in the dialog (often it
  5520.  * will be the BulletinBoard child of a DialogShell).
  5521.  */
  5522.  
  5523. ForceDialog(w)
  5524.      Widget w;
  5525. {
  5526.   Widget diashell, topshell;
  5527.   Window diawindow, topwindow;
  5528.   Display *dpy;
  5529.   XWindowAttributes xwa;
  5530.   XEvent event;
  5531.   XtAppContext cxt;
  5532.  
  5533. /* Locate the shell we are interested in.  In a particular instance, you
  5534.  * may know these shells already.
  5535.  */
  5536.  
  5537.   for (diashell = w;
  5538.        !XtIsShell(diashell);
  5539.        diashell = XtParent(diashell))
  5540.     ;
  5541.  
  5542. /* Locate its primary window's shell (which may be the same) */
  5543.  
  5544.   for (topshell = diashell;
  5545.        !XtIsTopLevelShell(topshell);
  5546.        topshell = XtParent(topshell))
  5547.     ;
  5548.  
  5549.   if (XtIsRealized(diashell) && XtIsRealized(topshell)) {
  5550.     dpy = XtDisplay(topshell);
  5551.     diawindow = XtWindow(diashell);
  5552.     topwindow = XtWindow(topshell);
  5553.     cxt = XtWidgetToApplicationContext(diashell);
  5554.  
  5555. /* Wait for the dialog to be mapped.  It's guaranteed to become so unless... */
  5556.  
  5557.     while (XGetWindowAttributes(dpy, diawindow, &xwa),
  5558.            xwa.map_state != IsViewable) {
  5559.  
  5560. /* ...if the primary is (or becomes) unviewable or unmapped, it's
  5561.    probably iconified, and nothing will happen. */
  5562.  
  5563.       if (XGetWindowAttributes(dpy, topwindow, &xwa),
  5564.           xwa.map_state != IsViewable)
  5565.         break;
  5566.  
  5567. /* At this stage, we are guaranteed there will be an event of some kind.
  5568.    Beware; we are presumably in a callback, so this can recurse. */
  5569.  
  5570.       XtAppNextEvent(cxt, &event);
  5571.       XtDispatchEvent(&event);
  5572.     }
  5573.   }
  5574.  
  5575. /* The next XSync() will get an expose event if the dialog was unmapped. */
  5576.  
  5577.   XmUpdateDisplay(topshell);
  5578. }
  5579.  
  5580.  
  5581. -----------------------------------------------------------------------------
  5582. Subject: 144)* How can I control placement of a popup widget?  Each time a
  5583. popup is created, it is placed in or over the middle of its parent.  How can I
  5584. make it obey the XmNx and XmNy values?
  5585.  
  5586. [Last modified: Feb 95]
  5587. Answer: Set the resource XmNdefaultPosition for the popup to False.  Set the
  5588. position of the popup by the resource values of XmNx and XmNy.  Do not use
  5589. XtMoveWidget, as this is for widget writers only.  Here's a demo program from
  5590. Dan Heller:
  5591.  
  5592. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  5593.  * This program is freely distributable without licensing fees and
  5594.  * is provided without guarantee or warranty expressed or implied.
  5595.  * This program is -not- in the public domain.  This program is
  5596.  * taken from the Motif Programming Manual, O'Reilly Volume 6.
  5597.  */
  5598.  
  5599. /* map_dlg.c -- Use the XmNmapCallback to automatically position
  5600.  * a dialog on the screen.  Each time the dialog is displayed, it
  5601.  * is mapped down and to the right by 200 pixels in each direction.
  5602.  */
  5603. #include <Xm/MessageB.h>
  5604. #include <Xm/PushB.h>
  5605.  
  5606. /* main() --create a pushbutton whose callback pops up a dialog box */
  5607. main(argc, argv)
  5608. char *argv[];
  5609. {
  5610.     Widget toplevel, button;
  5611.     XtAppContext app;
  5612.     void pushed();
  5613.  
  5614.     toplevel = XtVaAppInitialize(&app, "Demos",
  5615.         NULL, 0, &argc, argv, NULL, NULL);
  5616.  
  5617.     button = XtCreateManagedWidget("button", xmPushButtonWidgetClass,
  5618.         toplevel, NULL, 0);
  5619.     XtAddCallback(button, XmNactivateCallback, pushed, "Hello World");
  5620.  
  5621.     XtRealizeWidget(toplevel);
  5622.     XtAppMainLoop(app);
  5623. }
  5624.  
  5625. /* callback function for XmNmapCallback.  Position dialog in 200 pixel
  5626.  * "steps".  When the edge of the screen is hit, start over.
  5627.  */
  5628. static void
  5629. map_dialog(dialog, client_data, cbs)
  5630. Widget dialog;
  5631. XtPointer client_data;
  5632. XmAnyCallbackStruct *cbs;
  5633. {
  5634.     static Position x, y;
  5635.     Dimension w, h;
  5636.  
  5637.     XtVaGetValues(dialog, XmNwidth, &w, XmNheight, &h, NULL);
  5638.     if ((x + w) >= WidthOfScreen(XtScreen(dialog)))
  5639.         x = 0;
  5640.     if ((y + h) >= HeightOfScreen(XtScreen(dialog)))
  5641.         y = 0;
  5642.     XtVaSetValues(dialog, XmNx, x, XmNy, y, NULL);
  5643.     x += 200, y += 200;
  5644. }
  5645.  
  5646. /* pushed() --the callback routine for the main app's pushbutton.
  5647.  * Create and popup a dialog box that has callback functions for
  5648.  * the Ok, Cancel and Help buttons.
  5649.  */
  5650. void
  5651. pushed(w, message)
  5652. Widget w;
  5653. char *message; /* The client_data parameter passed by XtAddCallback */
  5654. {
  5655.     Widget dialog;
  5656.     Arg arg[3];
  5657.     XmString t = XmStringCreateLocalized(message);
  5658.     extern void response();
  5659.  
  5660.     XtSetArg(arg[0], XmNautoUnmanage, False);
  5661.     XtSetArg(arg[1], XmNmessageString, t);
  5662.     XtSetArg(arg[2], XmNdefaultPosition, False);
  5663.     dialog = XmCreateMessageDialog(w, "notice", arg, 3);
  5664.     XmStringFree(t);
  5665.  
  5666.     XtAddCallback(dialog, XmNmapCallback, map_dialog, NULL);
  5667.  
  5668.     XtManageChild(dialog);
  5669.     XtPopup(XtParent(dialog), XtGrabNone);
  5670. }
  5671.  
  5672.  
  5673. -----------------------------------------------------------------------------
  5674. Subject: 145)  TOPIC: LANGUAGE BINDINGS
  5675.  
  5676. -----------------------------------------------------------------------------
  5677. Subject: 146)  Is there a C++ binding for Motif?
  5678.  
  5679. [Last modified: Dec 94]
  5680.  
  5681.  
  5682. Answer: Wind/U implements MFC (Microsoft Foundation Classes) on Unix using
  5683. Motif.  Bristol Technology, Inc. (203) 438-6969, info@bristol.com.
  5684.  
  5685. WWL is a library which defines C++ classes around X Toolkit Widgets.  It is
  5686. intended to simplify the task of C++ code writers when using the Toolkit by
  5687. providing them with C++ objects, methods, type checking and several utility
  5688. functions and classes.
  5689.  
  5690. WWL has been tested under SunOs4.0.3 on sun3 and sun4, HPUX version 6.5 and
  5691. 7.0 and Ultrix 4.0 on DECstation 3100 and 5000. It is expected to work on most
  5692. other UNIX systems without too many problems.
  5693.  
  5694. WWL is distributed as a tar file with all the source, documentation and
  5695. example. The file is available using anonymous ftp from
  5696.  
  5697.         ftp.x.org            /R5contrib/WWW-1.2.tar.Z
  5698.  
  5699. ( ftp://ftp.x.org/R5contrib/WWW-1.2.tar.Z )
  5700.  
  5701. Answer: Rogue Wave Software has a C++ binding for Motif called View.h++.
  5702.  
  5703. "View.h++ is a complete C++ interface to OSF/Motif.  It doesn't just
  5704. encapsulate it, but also includes a set of classes that provide a level of
  5705. abstraction above Motif, thus simplifying menu and dialog creation, XmStrings,
  5706. XmFontLists, etc.  View.h++ supports a Model- View-Controller architecture,
  5707. allowing for an even more object-oriented interface design.  Includes a copy
  5708. of Rogue Wave's Tools.h++ (foundation class library)"
  5709.  
  5710. An object license is $795 "per seat" and a source code license is available
  5711. for $2,995 "per seat."  Rogue Wave also offers full support for View.h++.
  5712.  
  5713. It is currently available for Sun Sparc, IBM RS/6000, HP 9000/700 series, SCO,
  5714. Intel SVR4 ESIX.  Please call for Silicon Graphics and DEC Ultrix status.
  5715.  
  5716. For additional information, please contact:
  5717.  
  5718. Matt Steinauer
  5719. Rogue Wave Software, Inc.
  5720. P.O. Box 2328
  5721. Corvallis, OR 97339
  5722. Phone: (503)754-3010
  5723. Fax:   (503)757-6650
  5724.  
  5725. email:   matts@roguewave.com
  5726.  
  5727.  
  5728. Answer: Builder Xcessory 3.0, an interface builder from ICS, allows the user
  5729. to visually build C++ classes from Motif and user-written widgets.  C++ code
  5730. is generated in the "Doug Young" fashion.  (Doug actually worked on this
  5731. project with ICS.)  C and UIL can also be generated.
  5732.  
  5733. Integrated Computer Solutions, Inc. (ICS) 201 Broadway, Cambridge, MA  02139
  5734. USA info@ics.com   617/621-0060
  5735.  
  5736.  
  5737. Answer: From Andreas.Baecker@gmd.de: The GINA++ application framework contains
  5738. an encapsulation of the OSF/Motif widg et classes and the Xt functionality
  5739. into C++ classes. Its functionality is comparab le to that of the ULowell
  5740. binding and the WWL. Additionally, it provides an easy-to -use framework for
  5741. modeling new composite and primitive widget classes, plus an application
  5742. framework similar to ET++ or MacApp build on top of it. The binding may be
  5743. used independently from the framework classes. GINA++ is available through
  5744. anonymous ftp from ftp.gmd.de [129.26.8.90] in the directory /gmd/ginaplus.
  5745. Documentation about the Motif binding has been published in the X Resource
  5746. Journ al, Number 2, 1992, Pages 106-130. The binding compiles with AT&T C++
  5747. 2.1 and GNU G+ + 2.1 and has been tested on SunOS 4.1.[12], X11R4 and Motif
  5748. 1.1.3.
  5749.  
  5750. Answer: Motif++ is a library that defines C++ class "wrappers" for the widgets
  5751. defined in the X11R5 OSF/Motif-1.2 widget library.  It also supports
  5752. X11R4/Motif-1.1 as well.
  5753.  
  5754. Motif++ is also an application toolkit that provides other tools in
  5755. conjunction with the widget wrapper classes.  It has support for the Xbae
  5756. widget set, plus other widgets.  It has Imake support, and lots of test files.
  5757. Motif++ also has alot of contributed software.
  5758.  
  5759.  
  5760. Motif++ is very similar to other public domain widget libraries such as The
  5761. Widget Wrapper Library (WWL) and the C++ Binding for OSF/Motif developed at
  5762. the University of Lowell. The two latter libraries are the result of much
  5763. larger efforts.
  5764.  
  5765. Available via anonymous ftp:
  5766.  
  5767.         ftp://src.doc.ic.ac.uk/packages/motif++/motif++.30.jul.94.tar.gz
  5768.  
  5769. The /packages/motif++ also contains documentation.  For more information,
  5770. contact Ronald van Loon (rvloon@motif.xs4all.nl).  There is also mailing list
  5771. for Motif++:
  5772.  
  5773.         motif++@motif.xs4all.nl
  5774.  
  5775. To join, send email to the administrative address:
  5776.  
  5777.         motif++-request@motif.xs4all.nl
  5778.  
  5779. C++ Report, a magazine published by SIGS Publications, now regularly publishes
  5780. articles on X, Xt and Motif vs. C++ written by Ronald van Loon.
  5781.  
  5782. Answer: Xm++ is a user interface framework for the C++ language built upon X11
  5783. and the X-Toolkit. It is designed to be a simple and intuitive programming
  5784. interface to access the functionality of commonly used widgets.  Xm++ was
  5785. initially created for the Motif widget set, now support for the Athena widgets
  5786. was added. Applications created with Xm++ run in both environments without
  5787. changes, although many nice features are only available when using Motif.
  5788.  
  5789. Xm++ is available on: ftp.x.org as: /R5contrib/Xm++.0.53.tar.Z (
  5790. ftp://ftp.x.org/R5contrib/Xm++.0.53.tar.Z ).
  5791.  
  5792. Answer: wxWindows is a toolkit for platform-independent GUI programming in
  5793. C++. It consists of several class libraries and tools.  wxWindows has been
  5794. made freely available with no commercial restrictions. As well as undergoing
  5795. further development at AIAI ( http://www.aiai.ed.ac.uk/ ), outside
  5796. contributors are helping to extend its abilities and range of platforms.  See
  5797. http://www.aiai.ed.ac.uk/~jacs/wxwin.html .
  5798.  
  5799. Answer: The Solbourne OI toolkit (not Motif) also has a C++ binding.
  5800.  
  5801. Answer: Liant have C++/Views.
  5802.  
  5803. Answer: Quest have ObjectViews.  Answer: Builder Xcessory 3.0, an interface
  5804. builder from ICS, allows the user to visually build C++ classes from Motif and
  5805. user-written widgets.  C++ code is generated in the "Doug Young" fashion.
  5806. (Doug actually worked on this project with ICS.)  C and UIL can also be
  5807. generated.
  5808.  
  5809. Integrated Computer Solutions, Inc. (ICS) 201 Broadway, Cambridge, MA  02139
  5810. USA info@ics.com   617/621-0060
  5811.  
  5812.  
  5813. Answer: Doug Young has written a book "Object Oriented Programming with C++
  5814. and Motif", Prentice-Hall ISBN 0-13-630252-1 about using C++ without requiring
  5815. one of these toolkits.
  5816.  
  5817. Answer: Unfortunately, this library (last released in 9/92) has the same name
  5818. as the one by Ronald van Loon (rvloon@motif.hacktic.nl).  Motif++1.2 is a
  5819. library that defines C++ class "wrappers" for the widgets defined in the
  5820. OSF/Motif-1.1 widget library.  Motif++1.2 is also an application toolkit that
  5821. provides other tools in conjunction with the widget wrapper classes.
  5822.     One enhancement of Motif++1.2 beyond its wrapper classes are the addition
  5823. of an "application" class which takes care of the low-level tasks including
  5824. initializing X, creating and managing one or more top-level shells, and
  5825. entering the main event loop.
  5826.     Another feature of Motif++1.2 is its integration with The Widget Creation
  5827. Library (Wcl).  Motif++1.2 makes it easy to initialize Wcl and create C++
  5828. wrappers for desired widgets in the widget tree.
  5829.     Availability: anonymous FTP at ftp.arc.umn.edu (137.66.130.11), file
  5830. pub/Motif++1.2.tar.Z.  Contact Paul Felix, felix@ahpcrc.umn.edu or
  5831. pfelix@vx.cis.umn.edu.
  5832.  
  5833. submitted by: mvc!biggers@duke.cs.duke.edu ( Mark R. Biggers )
  5834.  
  5835. -----------------------------------------------------------------------------
  5836. Subject: 147)  How can I avoid C++ String class and typedef char *String
  5837. conflicts ?  We're using the USL C++ Standard Components which has the String
  5838. class.  This, however, conflicts with the typedef char *String found in
  5839. <X11/Intrinsic.h>
  5840.  
  5841. [Last modified: Oct 94]
  5842.  
  5843. Answer: This is very simple to workaround.  I agree that it is "wrong" but all
  5844. you need to do is:
  5845.  
  5846. #define String XtStringType
  5847. #include "all the X files"
  5848. #undef String
  5849.  
  5850.  
  5851. This will translate the offending symbol.
  5852.  
  5853. Thanks to Doug Rand <drand@x.org>
  5854.  
  5855. -----------------------------------------------------------------------------
  5856. Subject: 148)  How can I have a C++ member function in a callback?
  5857.  
  5858. [Last modified: Oct 94]
  5859.  
  5860. Answer: There are three common user problems with C++ callbacks.  First, make
  5861. sure you use the correct function prototype for the function declarations.
  5862. Second, the callback function must be declared as a static member of the
  5863. class.  Third, when registering it with XtAddCallback(), you must use its full
  5864. signature.  For example: (from Ken Lee, kenton@allegro.esd.sgi.com)
  5865.  
  5866.  
  5867.     class MyClass {
  5868.         ...
  5869.         void createWidgets();
  5870.         static void myButtonCB(Widget, XtPointer, XtPointer);
  5871.         ...
  5872.     };
  5873.     void MyClass::createWidgets() {
  5874.         ...
  5875.         w = XtCreatePushButton(...);
  5876.         XtAddCallback(w, XmNactivateCallback, &MyClass::myButtonCB,
  5877.             (XtPointer) this);
  5878.         ...
  5879.     }
  5880.     void myButtonCB(Widget w, XtPointer clientData, XtPointer callData) {
  5881.         MyClass *myclass = (MyClass *) clientData;
  5882.         ...
  5883.     }
  5884.  
  5885. Note that the "this" pointer is used as the client data.  This technique is
  5886. popular, but not required.
  5887.  
  5888.  
  5889. Motif++ has a nice tutorial summarizing mechanisms (Ronald van Loon,
  5890. rvloon@motif.xs4all.nl).  See his articles in the September, 1994 and
  5891. Nov/December, 1994 issues of C++ Report.
  5892.  
  5893. Doug Young's book deals extensively with one of these. The problem is that you
  5894. don't get the object when you just use the function as a callback.  You need
  5895. to pass the object as a pointer through as the client_data.  (use "this" as
  5896. the client_data.) Then you can retrieve the object's address, and dereference
  5897. from there. For example (Leo O'Donnell, Email: leo@avs.com),
  5898.  
  5899.     class MyButton {
  5900.       public:
  5901.                 MyButton (Widget parent, const char *name) {
  5902.                     _button = XtVaCreateManagedWidget (
  5903.                         name, xmPushButtonWidgetClass, parent, NULL, 0);
  5904.                     XtAddCallback (
  5905.                         _button,
  5906.                         XmNactivateCallback,
  5907.                         &MyButton::activateCB,
  5908.                         (XtPointer) this);
  5909.                 }
  5910.                 ~MyButton () { XtDestroyWidget (_button); }
  5911.       private:
  5912.         Widget  _button;
  5913.         static  void activateCB (Widget, XtPointer, XtPointer);
  5914.     };
  5915.  
  5916.     void MyButton::activateCB (Widget, XtPointer thisBtn, XtPointer)
  5917.     {
  5918.         MyButton *btn = (MyButton *) thisBtn;
  5919.  
  5920.         // OK you've got the button instance now. Do some stuff with it!
  5921.     }
  5922.  
  5923.  
  5924. -----------------------------------------------------------------------------
  5925. Subject: 149)  Is there a Common Lisp binding for Motif?
  5926.  
  5927. [Last modified: Oct 94]
  5928.  
  5929. Answer: Try CLM. This includes a toolkit demon (in C) that takes a widget
  5930. description (with callbacks), and forks a new process for each Motif
  5931. application (which can be just a single menu, or whatever).  Lisp can then
  5932. continue running, with a separate lightweight lisp process handling the
  5933. connection & callbacks.  In North America & net environs, CLM-2.3.tar.Z is
  5934. available from ftp.x.org.
  5935.  
  5936. There is also CLIM, the Common Lisp Interface Manager. It provides access to
  5937. motif and other toolkits and window systems.  Here is some blurb: "Version 2.0
  5938. of the Common Lisp Interface Manager (CLIM) provides access to Motif. CLIM is
  5939. the emerging standard for GUI development in Common Lisp.  It offers a set of
  5940. high-level facilities that enable rapid construction of user interfaces.
  5941. Applications written using CLIM are portable across a variety of window
  5942. systems and toolkits.  For example, on the X window System, both Motif
  5943. (OSF/Motif) and Openlook (OLIT) are supported.  CLIM accesses the toolkit
  5944. directly rather than emulating the look and feel."
  5945.  
  5946. CLIM is available from a variety of Common Lisp vendors including Symbolics
  5947. and Franz Inc. (info@franz.com).
  5948.  
  5949. -----------------------------------------------------------------------------
  5950. Subject: 150)  Is there an Ada binding for Motif? (Part 1 of 2)
  5951.  
  5952. [Last modified: Apr 94 ]
  5953.  
  5954. Answer:
  5955.  
  5956. Answer:  Integrated Computer Solutions, Inc. (ICS) supplies Ada bindings to
  5957. Motif for a number of platforms and Ada compilers.  ICS also provides Builder
  5958. Xcessory, a Motif interface builder, which outputs Ada code usable with the
  5959. Ada bindings.  The product family is known collectively as the Ada Xcessories.
  5960.  
  5961. Integrated Computer Solutions, Inc. (ICS) 201 Broadway, Cambridge, MA  02139
  5962. USA info@ics.com   617/621-0060
  5963.  
  5964.  
  5965. Information on Ada bindings to Motif and other services (such as SQL and
  5966. POSIX) can be found in a document maintained by the Ada Information
  5967. Clearinghouse.  The report can be found at
  5968.  
  5969.         host:   ajpo.sei.cmu.edu
  5970.         loc:    /public/ada-info/bindings.hlp.*
  5971.         access: anonymous ftp
  5972.  
  5973. The suffix to the file (indicated above with an asterix) is the date of the
  5974. latest update to the document.  For example, the full name of the report
  5975. updated on 14 June 1993 would be
  5976.  
  5977.         /public/ada-info/bindings.hlp.14Jun93.
  5978.  
  5979. The file is ASCII.
  5980.  
  5981. ------ Included File
  5982.  
  5983.  
  5984. [...Excerpted from the AdaIC report bindings.hlp.14Jun93...]
  5985. [...Updates can be found on ajpo.sei.cmu.edu, in the    ...]
  5986. [...file /public/ada-info/bindings.hlp.*  The suffix    ...]
  5987. [...is always the date of the lastest version to the    ...]
  5988. [...report.                                             ...]
  5989.  
  5990.                                      SECTION 12
  5991.                                   X-Window System:
  5992.                                OSF Motif and Open Look
  5993.                                Available Ada Bindings
  5994.  
  5995.  
  5996. 12.1  Description and Standardization Efforts
  5997.  
  5998. The X-Window System is a network-transparent window system.  It supports one
  5999. or more screens containing overlapping windows or subwindows.  X display
  6000. servers distribute user input to and accept output requests from various
  6001. client programs located either on the same machine or elsewhere in the
  6002. network.
  6003.  
  6004.             OSF Motif (Open Software Foundation/Motif) is a graphical user
  6005.             interface from OSF that provides a Presentation Manager look and
  6006.             feel for applications running on any system with X Window version
  6007.             11.  It conforms to POSIX, ANSI C and X/Open's XPG3 standards.
  6008.  
  6009. 12.2  Resources Available from Software Reuse Libraries/Repositories
  6010.  
  6011.  
  6012. ASSET                                                      (Updated:  November
  6013. 1 992)
  6014.  
  6015. The following information was taken in its entirety from the ASSET Library
  6016. Repository Catalog, October 9, 1992.  For more information on ASSET, see
  6017. Appendix C.
  6018.  
  6019.  
  6020. INTERFACE TO THE X WINDOW SYSTEM
  6021.  
  6022. VERSION_NUMBER    : 1.1
  6023. DEVELOPED_BY      : SAIC
  6024. RELEASE_DATE      : 29-SEP-88
  6025. UNIQUE_IDENTIFIER : ASSET_A_240
  6026. ALTERNATE_NAME    : SAICX2
  6027. ASSET_TYPE        : SOFTWARE CODE
  6028. FUNCTIONS         : INTERFACE, BIND
  6029. OBJECTS           : ADA, X WINDOWS
  6030. KEYWORDS          : STANDARDS, BINDINGS
  6031. COLLECTION        : STARS FOUNDATIONS
  6032. DISTRIBUTION      : UNLIMITED
  6033.  
  6034. DESCRIPTION       :
  6035.  
  6036. Interface to the X Window System
  6037.       An expression of the various concepts in Ada that provides a full,
  6038. working Ada specification of the X Window system.
  6039.      Approved for public release; distribution is unlimited.
  6040.  
  6041. 12.3  Products Available from Vendors
  6042.  
  6043.  
  6044. Advanced Technology Center                                 (Updated:  November
  6045. 1 992)
  6046.  
  6047. The Advanced Technology Center (ATC) has an Ada binding to OSF Motif for their
  6048. AXI~ product.  AXI is currently available for most UNIX-based platforms, and
  6049. is supported by Verdix, Meridian, and TeleSoft compilers.
  6050.  
  6051. AXI is an Ada-to-X-Window System interface that provides the Ada programmer
  6052. access to the 500+ functions, libraries, and procedures contained in the X
  6053. library (Xlib), the X Toolkit (Xt), the X Extensible Library, the X
  6054. Miscellaneous Utilities, the Motif widget set and the Motif Resource Manager.
  6055.  
  6056. ATC is planning to develop an Ada binding to Open Look for AXI.
  6057.  
  6058. For more information, contact:Larry Paulson, Advanced Technology Center, 22982
  6059.                         Mill Creek Drive, Laguna Hills, CA  92653, USA; Phone:
  6060.                         714-583-9119
  6061.  
  6062.  
  6063. Alsys, Inc.                                                     (Updated:  May
  6064. 1 992)
  6065.  
  6066. The Alsys Ada Software Development Environment (Alsys's validated Ada compiler
  6067. #901221W1.11103) for 386 UNIX is a production-quality Ada environment capable
  6068. of handling very large Ada applications (over 500,000 lines of code).  The
  6069. product includes the Compiler; Multi-Library Environment, which provides a
  6070. powerful and flexible way to manage Ada development effort and share program
  6071. units; Binder, which supports unused subprograms elimination; High-and Low-
  6072. Level Optimizers for improving code quality and performance; and Run-Time
  6073. Executive for efficient support for executing Ada programs.  Also included is
  6074. the Developer's Toolset including:  Ada Probe, a symbolic source level
  6075. debugger and program viewer; AdaXref, a cross-reference generator; AdaMake, a
  6076. recompilation aid; AdaReformat, a source reformatter.
  6077.  
  6078. Alsys currently has Ada bindings to POSIX, X-Windows (OSF Motif), and the
  6079. Generic Package of Elementary Functions for the Alsys Ada Software Development
  6080. Environment, running on 386 UNIX 386/486-based machines supported as both host
  6081. and target and running 386/ix or SCO UNIX.  They are also planning a binding
  6082. to SQL for  386/486 machines.
  6083.  
  6084. Host/Target:386/486 PC under IX UNIX, 386/486 PC under SCO UNIX
  6085.  
  6086. The Alsys Ada Software Development Environment for the IBM RS/6000 is a
  6087. production-quality Ada environment capable of handling very large Ada
  6088. applications.  Hosted on and targeted to the IBM RS/6000 workstation under
  6089. IBM's AIX operating system, the product includes the Compiler; Multi-Library
  6090. Environment, which provides a  powerful and flexible way to manage Ada
  6091. development efforts and share program units; Binder; Run-Time Executive; and
  6092. both a High and Low-Level Optimizer for improving code quality and
  6093. performance.  Also included is the Alsys Ada Toolset including Ada Probe,
  6094. symbolic source level debugger and program viewer; AdaXref, cross-reference
  6095. generator; AdaMake, recompilation aid; and AdaReformat, source reformatter.
  6096.  
  6097. Alsys has bindings currently available to the Generic Package of Elementary
  6098. Functions and to X-Windows (OSF Motif) for the Alsys Ada Development
  6099. Environment for the IBM RS/6000 running on any RISC System/6000 machine as
  6100. both host and target and running IBM's AIX operating system (Alsys's validated
  6101. Ada compiler #910809W1.11195).   Alsys also plans to develop a POSIX binding
  6102. for the RS/6000.
  6103.  
  6104. Host/Target:RISC System/6000 under AIX
  6105.  
  6106. The Alsys Ada Software Development Environment for SPARC Workstations is a
  6107. production-quality Ada environment capable of handling very large Ada
  6108. applications.  Hosted on any SPARC-based workstation under SunOS or SunView,
  6109. the product helps you realize the full potential of Ada on SPARC machines. The
  6110. product includes the Compiler (with High- and Low-Level Optimizers); Binder,
  6111. which supports unused subprogram elimination; Multi-Library system (Family,
  6112. Library, and Unit Managers) which provides a powerful and flexible way to
  6113. manage Ada development efforts and share program units;  AdaExec real-time
  6114. executive, for complete and efficient support for executing Ada programs; and
  6115. ISO-standard mathematical library.  Also included is the Alsys Ada Toolset
  6116. including AdaProbe, symbolic source level debugger and program viewer;
  6117. AdaXref, cross-reference  generator; AdaMake, recompilation aid; and
  6118. AdaReformat, source reformatter.
  6119.  
  6120. Bindings to the Generic Package of Elementary Functions and to OSF/Motif are
  6121. currently available for the Alsys Ada Software Development Environment running
  6122. on any SPARC-based Workstation as both host and target and running SunOS or
  6123. SunView.
  6124.  
  6125. Host/Target:SPARC under SUNOS
  6126.  
  6127. For more information, contact:Scott Garren, Alsys, Inc., 67 South Bedford
  6128.                         Street, Burlington, MA  01803-5152, USA;  Phone:
  6129.                         (617) 270-0030
  6130.  
  6131.  
  6132. Digital Equipment Corporation                              (Updated:  November
  6133. 1 992)
  6134.  
  6135. Digital Equipment Corporation has bindings available for GKS, PHIGS, SQL, and
  6136. OSF Motif for VAX Ada/VMS.  The Ada bindings are provided either as part of a
  6137. compiler product or the services/facilities that are provided by Digital and
  6138. its suppliers.
  6139.  
  6140. Host/Target:DEC VAX under VMS
  6141.  
  6142. For more information, contact:Mary Anne Cacciola, Digital Equipment
  6143.                         Corporation, 110 Spit Brook Road, Nashua, NH  03062,
  6144.                         USA; Phone:  (603) 881-1028
  6145.  
  6146.  
  6147. IBM                                                        (Updated:  November
  6148. 1 992)
  6149.  
  6150. IBM's AIX Ada/6000 product provides a binding to GPEF and IBM AIXWindows (X-
  6151. Windows ... not Motif).  It runs on all models of the IBM RISC System/6000
  6152. under the IBM AIX Version 3.2 operating system. See also entries for Systems
  6153. Engineering Research Corporation (SERC) and Advanced Technology Center (ATC)
  6154. for Motif, GKS or PHIGS bindings for use with IBM AIX Ada/6000 products.
  6155.  
  6156.  
  6157. The AIX Ada/6000 licensed programs (5706-291 and 5706-294) consist of an
  6158. optimizing compiler, a run-time environment, a symbolic debugger, an Ada
  6159. "makefile" generator for use in automating and minimizing recompilation, Ada
  6160. library management tools and Ada language bindings to some key AIX subsystems.
  6161. With the exception of some system-specific aspects of the language, the Ada
  6162. language for the AIX operating system is source compatible with the Ada
  6163. language supported by IBM licensed programs in VM/CMS and MVS.
  6164.  
  6165. Host/Target:IBM RISC System/6000 under the IBM AIX Version 3.2 operating
  6166.             system
  6167.  
  6168. This product conforms to the following standards:  ANSI/MIL-STD-1815A - Ada at
  6169. current level (1.11) of the ACVC test suite.
  6170.  
  6171. For more information, contact:Barry Lee, IBM Corporation, 844 Don Mills Road,
  6172.                         North York, Ontario, Canada  M3C 1V7; Phone:  (416)
  6173.                         448-3174; Fax: (416) 448-4810
  6174.  
  6175. Objective Interface Systems, Inc.                          (Updated:  November
  6176. 1 992)
  6177.  
  6178. Objective Interface Systems, Inc., has an Ada binding to X-windows (OSF Motif)
  6179. for its Screen Machine~ product.  The Screen Machine binding to Motif includes
  6180. a WYSIWYG drawing tool and an Ada code generator.
  6181.  
  6182. Host/Target:
  6183.  
  6184.       Sun SPARC/SunOS         Rational R1000/Delta    HP 9000/7XX; 8X7
  6185.       IBM RISC System/6000/AIXPC 386/486/ISC UNIX     HFSI WIS Workstation
  6186.       PC 286/386/486/MS-DOS   PC 386/486/SCO UNIX     DEC Ultrix; DEC VMS
  6187.  
  6188. For more information, contact:Phil Carrasco, Object Interface Systems, Inc.
  6189.                         1895 Preston White Drive, Suite 250, Reston, VA
  6190.                         22091-5448, USA; Phone: (703) 264-1900; Fax:
  6191.                         703-264-1721; email info@ois.com (internet)
  6192.  
  6193.  
  6194. SL Corporation                                              (Updated: November
  6195. 1 992)
  6196.  
  6197. SL Corporation's SL-GMS toolkit includes Ada bindings to GPEF, GPPF, POSIX,
  6198. SQL, TCP/IP, OSF/Motif, and Open Look.
  6199.  
  6200. SL-GMS is a toolkit for developing dynamic graphics screens for real-time or
  6201. highly interactive applications.  Non-programmers can design application
  6202. screens in a standard drawing-tool mode, connect them to real-time data
  6203. sources and animate screen objects to visualize changing data values.  SL-GMS
  6204. allows the design of custom "GISMOs" to input values or control the
  6205. application and supports MOTIF, OPEN LOOK and other X toolkit widgets.
  6206.  
  6207. SL-GMS is used extensively to provide real-time graphics for applications in
  6208. the fields of manufacturing, process control, network management, avionics and
  6209. financial tracking.
  6210.  
  6211. Host/Target:Validated Verdix and DEC compilers support SL-GMS for the
  6212.             following machines as both host and target:
  6213.  
  6214.  
  6215.       DEC-DECstation/ULTRIX 4.0DEC-VAXstation/ULTRIX 4.0
  6216.       DEC-VAXstation/VMS 5.4  DEC-VAXstation/VMS 5.5
  6217.  
  6218.       IBM-RS6000/AIX
  6219.  
  6220.       HP-9000/300/UNIX        HP-9000/400/UNIX
  6221.       HP-9000/800/UNIX        HP-9000/700/UNIX
  6222.  
  6223.       PC-386/IX UNIX          PC-386/SCO UNIX
  6224.       PC-386/Lynx             PC-386/0S2
  6225.       PC-386/System 5.4
  6226.  
  6227.       SGI-4D/IRIX 3.3
  6228.  
  6229.       Sun-3/SunOS 4.1         SunSPARC/SunOS 4.1
  6230.  
  6231.       88 Open/BCS Compliant
  6232.  
  6233. For more information, contact: Mike Meagher, SL Corporation, 240 Tamal Vista
  6234.                         Boulevard, Corte Madera, CA  94926, USA Phone: (415)
  6235.                         927-1724; Fax: (415) 927-2931
  6236.  
  6237.  
  6238. Sunrise Software International                                  (Updated:  May
  6239. 1 992)
  6240.  
  6241. Sunrise Software International's product, ezx, is a rapid application
  6242. development tool that automates the creation of graphical user interfaces for
  6243. OSF/MOTIF and generates C, UIL, or Ada.  ezx provides WYSIWYG screen layout;
  6244. color, font and pixmap editors; presentation tools and dialog management.  A
  6245. prototype can be developed in hours and using a script language similar to
  6246. Hypertalk, demonstrated to end-users before the first line of code is written.
  6247. Then portable C, UIL or Ada can be generated automatically.  Ada bindings are
  6248. provided.  The total code required to develop a GUI is reduced by
  6249. approximately 75%.   The appearance and behavior of the GUI is defined in an X
  6250. resource file which the application loads at run time.  This provides explicit
  6251. separation between the GUI and the computational core of the application. Thus
  6252. the GUI can be revised without recompiling (and retesting) the application.
  6253.  
  6254. ezx provides cost savings throughout the software development cycle, from
  6255. requirements analysis through design, code, test and maintenance.
  6256.  
  6257.  
  6258. Host/Target:DEC RISC under ULTRIX, DEC VAX under VMS, IBM 386 under UNIX, IBM
  6259.             RS 6000 under AIX, SGI under , SUN SPARC under UNIX
  6260.  
  6261. For more information, contact:Frederick Sells, Sunrise Software International,
  6262.                         170 Enterprise Center, Middletown, RI  02840, USA;
  6263.                         Phone:  401-847-7868
  6264.  
  6265. Systems Engineering Research Corporation (SERC)            (Updated:  November
  6266. 1 992)
  6267.  
  6268. -----------------------------------------------------------------------------
  6269. END OF PART FOUR
  6270. Archive-name: motif-faq/part5
  6271. Last-modified: FEB 11, 1995
  6272. Posting-Frequency: monthly
  6273. Organization: Century Computing, Inc.
  6274. Version: 4.1
  6275.  
  6276.  
  6277.  
  6278. -----------------------------------------------------------------------------
  6279. Subject: 151)+ Is there an Ada binding for Motif? (Part 2 of 2)
  6280.  
  6281. [Last modified: Apr 94 ]
  6282.  
  6283. Answer: (This answer hasn't changed since the date given, but I needed to
  6284. break it into 2 parts.)
  6285.  
  6286. SERC's Ada/MOTIF is a complete binding to X Window and OSF/Motif for the Ada
  6287. programming language that was based in part upon the SAIC/Unisys (STARS)
  6288. public domain bindings.  That work was leveraged as a starting point for this
  6289. development; many of the bug fixes and additional capabilities beyond the
  6290. public domain releases in Ada/MOTIF have been incorporated.  Most noteworthy
  6291. are the capabilities included in Ada/Motif for Ada tasking, callback
  6292. registration, memory leak detection/prevention and capabilities for developing
  6293. customized widgets.  Paramax/STARS considers Ada/Motif to be the commercial
  6294. version of their STARS bindings, according to SERC.
  6295.  
  6296. Ada/MOTIF is supported by the ALSYS, VERDIX, SUNAda, IBM Ada, and SGI Ada
  6297. compilers.
  6298.  
  6299.  
  6300. Host/Target:SUN 4, HP 300/400, HP 700, IBM RS 6000, SGI, 386
  6301.             SUN OS 4.1.1, SOLARIS 2.0 (coming), HPUX 8.0, SGI 3.2 & 4.0, IBM
  6302.             ATX 3.2, SCO 3.2
  6303.  
  6304. For more information, contact:Theo Kusiolek or Scott Cleveland, Systems
  6305.                         Engineering Research Corporation (SERC), 2555
  6306.                         Charleston Road, Mountain View, CA  94043, USA; Phone:
  6307.                         800-ADA-SERC or 415/962-9092; Fax:  415/962-0330;
  6308.                         E-mail:  Well!sercmail@apple.com.
  6309.  
  6310.  
  6311. TeleSoft                                                   (Updated:  November
  6312. 1 992)
  6313.  
  6314. TeleSoft's TeleUSE/Ada automates the creation of OSF/Motif graphical user
  6315. interfaces for Ada applications.  It includes a special version of the TeleUse
  6316. User Interface Management System -- which generates Ada source code -- and Ada
  6317. bindings to the TeleUSE run-time routines.
  6318.  
  6319. TeleUse/Ada tools allow a GUI to be prototyped and designed using a WYSIWYG
  6320. editor and a PDL, and also includes tools for debugging, generating production
  6321. code and maintaining the GUI.  TeleUse/Ada can save the developer up to 90
  6322. percent of the time required to hand code X Window System GUIs.
  6323.  
  6324. Host/Target:SPARC under UNIX, Sun-4 under UNIX
  6325.  
  6326.  
  6327. TeleSoft's TeleWindows is a set of Ada bindings to the X Window System and
  6328. OSF/Motif.  This includes Xlib, XT, X extensions Library, XT+, X miscellaneous
  6329. utilities, Motif widget set, XM, MWM, Motif resource manager.  It supports X-
  6330. 11 R4 and is not based on the public domain version.  It closely follows the C
  6331. Xlib syntax and allows Ada applications to co-exist with C applications.
  6332.  
  6333. Host/Target:IBM System/370 under VM/CMS
  6334.  
  6335. For more information, contact:Karen Johnson, TeleSoft, 5959 Cornerstone Court
  6336.                         West, San Diego, CA  92121-9891, USA; Phone:  (619)
  6337.                         457-2700
  6338.  
  6339. Verdix                                                          (Updated:  May
  6340. 1 992)
  6341.  
  6342. The Verdix Ada Development System (VADS), is a complete Ada Compiler System
  6343. offering a fully validated Ada compiler with chapter 13 support.  Verdix
  6344. supplies VADSself and VADScross.   VADSself provides a complete toolset for
  6345. self-targeted applications.  It easily interfaces to databases, windowing
  6346. systems and program management tools.  VADScross provides real-time support
  6347. for host-to-target system development.  VADScross produces small and fast
  6348. object code.  VADS is hosted on the largest number of platforms and targets
  6349. the greatest number of microprocessors.
  6350.  
  6351. Host/Target:88000 BCS under UNIX, DEC VAX under VMS / ULTRIX / UNIX,
  6352.             DECStation (RISC) under UNIX, DECSystem (RISC) under UNIX, HP 9000
  6353.             Series 300 under HP-UX  (UNIX), IBM PS/2 under AIX  (UNIX), IBM
  6354.             RISC System/6000 under AIX, SCO Systems V/386 (ABI) under UNIX,
  6355.             Sun SPARC systems under UNIX, Sun-3 systems under UNIX
  6356.  
  6357. Verdix AXI provides an Ada binding to the full Motif, Xt, and Xlib libraries.
  6358. The product works with user-supplied Motif 1.1 and X11R4 libraries regardless
  6359. of source.
  6360.  
  6361. Host/Target:DEC RISC under Ultrix, IBM RS6000 under AIX, MIPS under MIPSos,
  6362.             Sun-4 under SunOS, Sys V386 under ISC UNIX, Sys V386 under SCO
  6363.             UNIX
  6364.  
  6365. For more information, contact:Tim Ruhe, Verdix Corporation, 205 Van Buren,
  6366.                         Herndon, VA  22070, USA; Phone:  (703) 318-5800
  6367.  
  6368. Answer: Integrated Computer Solutions, Inc. (ICS) supplies Ada bindings to
  6369. Motif for a number of platforms and Ada compilers.  ICS also provides Builder
  6370. Xcessory, a Motif interface builder, which outputs Ada code usable with the
  6371. Ada bindings.  The product family is known collectively as the Ada Xcessories.
  6372.  
  6373. Integrated Computer Solutions, Inc. (ICS) 201 Broadway, Cambridge, MA  02139
  6374. USA info@ics.com   617/621-0060
  6375.  
  6376. -----------------------------------------------------------------------------
  6377. Subject: 152)  Is there a Poplog binding for Motif?
  6378.  
  6379. [Last modified: May 93]
  6380.  
  6381. Answer:
  6382.  A integrated programming environment consisting of the programming
  6383.     languages Pop-11, Prolog, Standard ML, and Lisp which are compiled
  6384.     to machine code via a common virtual machine. Pop-11 provides a rich
  6385.     interface to the X Toolkit which can be accessed from all other
  6386.     Poplog languages. The OLIT, Motif, and Athena widget sets are
  6387.     supported, in addition to the custom Poplog (Xpw) widget set. XVed
  6388.     provides a sophisticated, customisable multi-window editor. Under
  6389.     OPEN LOOK and Motif the Poplog User Interface (PUI) provides a
  6390.     graphical interface to the Poplog system. High-level Pop-11
  6391.     libraries allow graph drawing, turtle graphics, and the simple
  6392.     creation of basic button/menu based interfaces.
  6393.  
  6394. Contact:
  6395.  
  6396.  
  6397.     UK EDUCATION SITES:
  6398.         Poplog Sales. School of Cognitive and Computing Sciences.
  6399.         Brighton. BN1 9QN. England.
  6400.         Phone: +44 (0)273 678188
  6401.         Email: popsales@cogs.susx.ac.uk
  6402.     USA AND CANADIAN EDUCATION SITES:
  6403.         Computable Functions Inc. 35 South Orchard Drive. Amherst.
  6404.         MA 01002. USA.
  6405.         Phone: (413) 253-7637
  6406.     ALL OTHER SALES:
  6407.         Integral Solutions Ltd. Unit 3, Campbell Court. Bramley.
  6408.         Basingstoke. Hampshire. RG26 5EG. England.
  6409.         Phone:  +44 (0)256 882028
  6410.         Fax:    +44 (0)256 882182
  6411.         Email:  isl@integ.uucp
  6412.  
  6413.  
  6414. -----------------------------------------------------------------------------
  6415. Subject: 153)  TOPIC: SPECIFIC PLATFORMS
  6416.  
  6417. -----------------------------------------------------------------------------
  6418. Subject: 154)  Is it easy to build Motif for a Sun?
  6419.  
  6420. Answer: See next question for Solaris 2.  No pattern has emerged to problems
  6421. about compiling Motif on the Sun (although people seem to have a lot of
  6422. different minor problems), and many reports are that it is straightforward.
  6423. Read the Motif install instructions (which often have specific reference to
  6424. Sun installation), light the blue touch paper and just standback. [My
  6425. experience was that I had to add -D_NO_PROTO for 1.1 on a Sparc OS 4.1, and
  6426. that was all.  Others have added STRINGS_ALIGNED and NO_REGEXP].
  6427.  
  6428.  
  6429. -----------------------------------------------------------------------------
  6430. Subject: 155)  How do I build Motif 1.2.2 on Solaris 2.1 with Sun C?
  6431.  
  6432. [Last modified: Oct 94]
  6433.  
  6434. Prepared by Ric Steinberger.  ric@updike.sri.com  4/09/93
  6435.  
  6436. What follows is a description of the steps I used to build Motif 1.2.2 on a
  6437. SUN IPX running Solaris 2.1.  Sun's C compiler (2.0.1) was used.  Many thanks
  6438. go to Kaleb Keithley (kaleb@devvax.jpl.nasa.gov) for several useful
  6439. suggestions.  Other people, including OSF staff, especially David Brooks
  6440. (dbrooks@osf.org), helped as well.  My thanks to you all.
  6441.  
  6442. 1. Build X11R5 from the mit distribution.  You need to retrieve the sources
  6443.    from ftp.x.org (in pub/R5) and patches 1 - 22 (or fixes 1-26)
  6444.    pub/R5/fixes).  There are several other sites that contain the X11R5
  6445.    sources.  After installing patch 19, apply PEXlib.tar.Z, also available
  6446.    from ftp.x.org in pub/R5/fixes.  You can apply also
  6447.    R5.Xsun.multi-screen and R5.SunOS5.patch.  There are .README files
  6448.    that explain how to patch.  Be SURE to read
  6449.    R5.SunOS5.patch.README for details on how to BUILD X11.  You probably
  6450.    want to use the ProjectRoot feature in the site.def file in the
  6451.    mit/config directory.  You will NEED to edit that file to do that.
  6452.  
  6453. 2. Obtain the Motif 1.2.2 distribution from OSF (617-621-7300).  You may
  6454.    need to first install the 1.2 tape, then the 1.2.1 and finally the
  6455.    1.2.2 tape.  You might want to do a "chmod -R u+w ." after unloading
  6456.    each tape.
  6457.  
  6458. 3. In the config directory, there are several changes.  Some of the changes
  6459.    are based on R5.SunOS5.patch files.  A complete set of config files
  6460.    relevant to Solaris have been placed in the anon-ftp account of
  6461.    updike.sri.com in pub/motif/solaris21-motif122-config.tar.Z.  They are
  6462.    also available from OSF on their mail response server (available to
  6463.    support contract holders) and they will send them directly to full
  6464.    support contract holders.  Decompress and untar this file in your Motif
  6465.    config subdirectory.  Copy site.def.sample to site.def, then edit
  6466.    site.def.  You will probably want to uncomment the ProjectRoot section
  6467.    and use the same value used in your X11R5 build.  Also, you will probably
  6468.    want to use /usr/ucb/install in you installed the UCB compatibility
  6469.    suite.  Otherwise you might want to use the install supplied at the end
  6470.    of this memo.  [I used the UCB version and can't swear that this works.
  6471.    Bit it should.  Put it someplace like /usr/local/bin and chmod +x it.]
  6472.  
  6473.    There are two patches to consider.  One fixes a cursor problem
  6474.    in ./lib/Xm/TextF.c.  The other removes a Berkeleyism.  These
  6475.    patches should probably be consider unofficial at present.
  6476.    Failure to deal with the Berkeleyism (bzero) means you will need to
  6477.    link with -lucb -lelf.  This will probably work, but why bother?
  6478.    Furthermore, if you move the Motif binaries to a machine without
  6479.    the ucb compatability suite, you won't have the sharable libs you need.
  6480.  
  6481. [The actual patches have been censored because they contain OSF source code]
  6482.  
  6483.    Patch 1: In TextF.c there are several places _XmTextFieldDrawInsertionPoint
  6484. is called. These should be moved two or three lines further down *after* the
  6485. "if (!XtIsRealized(tf)) return True;" statement.
  6486.  
  6487.  
  6488.    patch 2: The call to bzero in lib/Xm/Visual.c should be replaced by the
  6489. equivalent call to memset
  6490.  
  6491.  
  6492.     Both these patches can be applied in the ./lib/Xm directory.
  6493.     If you don't have the patch program (how did you build X11?),
  6494.     you can get it in the vendor/cygnus directory of ftp.uu.net,
  6495.     or you can build it from source.  Be sure to get the latest
  6496.     version (2.0.12.u8).
  6497.  
  6498. 4) Use the README-1.2.1 file as a guideline for building motif.  I followed
  6499.    directions in the section called, "Using X11R5 Installed Libraries
  6500.    and Header Files."  If you make a mistake after your first build
  6501.    attempt, copy Makefile.ini to Makefile before retrying.  You may
  6502.    need to do this in the config subdirectory too, depending on what
  6503.    went wrong.
  6504.  
  6505. 5) After make Makefiles, do make includes, make depend, then make (or
  6506.    as OSF recommends, make -k).  This gets as far as motifshell in the
  6507.    demos, which fails to build because O_RDONLY and L_XTND are
  6508.    not defined.  O_RDONLY is in fcntl.h (actually <sys/fcntl.h>, but
  6509.    fcntl.h includes this.)  L_XTND can be replaced by SEEK_END.
  6510.    SEEK_END is in stdio.h.  These two fixes will allow motifshell to build.
  6511.    Note: many MANY compiler warning messages will be generated during
  6512.    the build process.
  6513.  
  6514. 6) You can go to the demos/xmsamplers directory and do a make there.
  6515.    Other demos may build, or not depending on whatever. . . .
  6516.  
  6517. 7) make install will do the install.  [It will fail at motifshell
  6518.    if you don't fix it, as mentioned above.]  You can do a make install
  6519.    in demos/xmsamplers if you want these.
  6520.  
  6521. 8) If running on a SUN (as opposed to an X term), you will (probably) need
  6522.    to start openwin with something like:
  6523.  
  6524.         openwin -server /usr/X11R5/bin/Xsun
  6525.  
  6526.  
  6527.    [You might want to use an alias for this.]
  6528.    This fixes an annoying problem: The mouse keys stop working after you
  6529.    click on an icon to get the icon menu (on SUNs only, not X terms).
  6530.    The ALT keys still work, if you get stuck.  I don't know whether this
  6531.    is a bug in SUN's server or whether it is Motif related.
  6532.  
  6533.    Here is a copy of my .xinitrc:  It's not elegant.  Sun's default
  6534.    openwin startup file is in: /usr/openwin/lib/Xinitrc.  You can
  6535.    copy this to ~/.xinitrc and customize as desired.  Obviously, the
  6536.    default behavior is to start the OpenLook environment (boo!).
  6537.  
  6538.  
  6539. #!/bin/sh
  6540. #
  6541. # .xinitrc - OpenWindows startup script.
  6542. #
  6543. if [ -f $HOME/.Xdefaults ]; then
  6544.     xrdb $HOME/.Xdefaults              # Load Users X11 resource database
  6545. fi
  6546. if [ -f $HOME/.Xdefaults.sun ]; then
  6547.     xrdb -merge $HOME/.Xdefaults.sun
  6548. fi
  6549. DISPLAY=`hostname`:0.0
  6550. export DISPLAY
  6551. xhost + > /dev/null
  6552. #xterm -sb -sl 512 -T `hostname` -ls -n `hostname` &
  6553. xterm -sb -sl 512 -T `hostname` -n `hostname` &
  6554. mwm &
  6555. xclock -geometry +1010+0 &
  6556. xload -geometry +710+5 -fg red &
  6557. xsetroot -solid salmon &
  6558. xterm -sb -sl 100 -T CONSOLE_DO_NOT_LOGOUT -C -n console -iconic
  6559. #wait
  6560.  
  6561. Here's .Xdefaults.sun, which gives me a more readable font for use with
  6562. motif on Sun monitors:
  6563.  
  6564. !Some additional .Xdefaults values specifically for SUN
  6565. !
  6566. ! After loading .Xdefaults, xrdb -merge .Xdefaults.sun
  6567. !
  6568. Mwm*fontList:           8x16
  6569. !Mwm*fontList:          vtbold
  6570. !Change as desired.
  6571.  
  6572.  
  6573.      You will probably want to maintain LD_LIBRARY_PATH to something like:
  6574. /opt/SUNWspro/lib:/usr/ccs/lib:/usr/ucblib:/usr/X11R5/lib:/usr/lib:
  6575. /usr/openwin/lib.  If you use emacs, you will need to leave /usr/openwin/lib
  6576. there.  [This is because you probably, like me, used the distributed version
  6577. of s-sol2.h, which explicitly refers to windowing libraries as being in the
  6578. /usr/openwin locations.  Yes, I know that emacs/Solaris ought to allow
  6579. LibXt.so.N.M to be "picked up" from elsewhere, like /usr/X11R5/lib, but the
  6580. one emacs links with is LibXt.so.4.something, and the mit one is
  6581. LibXt.so.5.something.  So it seems to want the .4 one.  Any comments?  I'd
  6582. prefer not to rebuild emacs based on the X11R5 libs because I occassionally
  6583. need to move the emacs binaries to machines without the mit files.]
  6584.  
  6585. -----------------------------------------------------------------------------
  6586. Subject: 156)  What compile errors/warnings might I get in both Sun 3 and Sun
  6587. 4?
  6588.  
  6589. Answer:
  6590.  
  6591.  
  6592. make: Warning: Too many rules defined for target
  6593. make: Warning: Too many rules defined for target
  6594. "callbacks.c", line 1530: warning: illegal combination of pointer
  6595. and integer, op =
  6596. "callbacks.c", line 1531: warning: illegal combination of pointer
  6597. and integer, op =
  6598. "callbacks.c", line 1532: warning: illegal combination of pointer
  6599. and integer, op =
  6600. "utils.c", line 73: warning: illegal combination of pointer and integer, op =
  6601. "utils.c", line 74: warning: illegal combination of pointer and integer, op =
  6602. "utils.c", line 122: warning: illegal combination of pointer and integer, op =
  6603. "utils.c", line 123: warning: illegal combination of pointer and integer, op =
  6604. "utils.c", line 191: warning: illegal combination of pointer and integer, op =
  6605. "utils.c", line 194: warning: illegal combination of pointer and integer, op =
  6606. "utils.c", line 195: warning: illegal combination of pointer and integer, op =
  6607. "utils.c", line 196: warning: illegal combination of pointer and integer, op =
  6608. "utils.c", line 316: warning: illegal combination of pointer and integer, op =
  6609. "utils.c", line 334: warning: illegal combination of pointer and integer, op =
  6610. "utils.c", line 338: warning: illegal combination of pointer and integer, op =
  6611. "utils.c", line 341: warning: illegal combination of pointer and integer, op =
  6612. "xmdialogs.c", line 838: warning: illegal combination of pointer
  6613. and integer, op =
  6614. "xmeditor.c", line 1152: warning: illegal combination of pointer
  6615. and integer, op =
  6616.  
  6617. These warning messages can be ignored. OSF is aware of these warnings.
  6618.  
  6619.  
  6620. -----------------------------------------------------------------------------
  6621. Subject: 157)  On a Sun 3, what are the mwm startup error messages about?  I
  6622. get
  6623.  
  6624. mwm: Invalid accelerator specification on line 7 of
  6625.      specification string
  6626. mwm: Invalid accelerator specification on line 31 of
  6627.       configuration file
  6628.  
  6629.  
  6630. Answer: This is because some Sun keyboards do not have an F10 key and some sun
  6631. workstations which have an F10 key do not have X-servers which recognize it.
  6632. The F10 key is used by mwm.  If the machine does have an F10 key, the user
  6633. should use xmodmap to tell the server it exists.  Otherwise, change the
  6634. definition of the DefaultWindowMenu in /usr/lib/X11/system.mwmrc (after
  6635. installation) or in /lib/clients/mwm/system.mwmrc (before installation).
  6636. Change the accelerator of "Maximize" (it is "Alt<Key>F10)" to something else.
  6637. Also, you should change the definition of DEFAULTSYSTEMMENU in the file
  6638. /clients/mwm/WmResource.c in a similar fashion.  There is as yet no standard
  6639. redefinition for F10.
  6640.  
  6641.  
  6642. -----------------------------------------------------------------------------
  6643. Subject: 158)  Are there problems making shared libraries on a Sun?
  6644.  
  6645. Answer: If you use the -pic option you may run out of offset table space.  use
  6646. the -PIC option instead.
  6647.  
  6648. You may get the message "ld.so: Undefined symbol: __XtInherit" when executing
  6649. UIL. There is a problem in shared library build when you compare a function
  6650. variable to a routine name, but don't call the routine.  Either, you can build
  6651. the Xt library nonshared, or you can put a reference to XtToolkitInitialize in
  6652. the UIL main program (or even include a module that references it).  The
  6653. routine doesn't even have to be called; it just has to be there.
  6654.  
  6655.  
  6656. -----------------------------------------------------------------------------
  6657. Subject: 159)  The OpenWindows server hangs when I popup a menu with Button 3.
  6658.  
  6659. [Last modified: August 92]
  6660.  
  6661. Answer: This is an OpenWindows problem, but if you have Motif source you can
  6662. fix your own applications. From Steve Sistare of Thinking Machines Corp.:
  6663. "Change the 2 calls to XtGrabButton in RowColumn.c such that ButtonReleaseMask
  6664. | ButtonPressMask is passed for the event mask.  Currently, only
  6665. ButtonReleaseMask is passed.  Also, change the owner_event argument to FALSE.
  6666. " This has not been fixed in Motif as at 1.1.5.
  6667.  
  6668. -----------------------------------------------------------------------------
  6669. Subject: 160)  Has anyone made shared libraries on an IBM RS/6000?
  6670.  
  6671. Answer: [NOTE: This may not a problem any longer; I believe that AIX is now
  6672. delivered with shared Xm libraries. If you know the status of this, email
  6673. ksall@cen.com.]
  6674.  
  6675. From Sakari Jalovaara: There is a problem: Xm redefines VendorShell and the
  6676. AIX linker put _both_ Xm's and Xt's VendorShell into programs.  When an AIX
  6677. shared library is created as many references inside the library are resolved
  6678. as possible.  If the symbol vendorShellClassRec is defined in libXt and
  6679. referenced, say, from a function XtFoo() also in libXt, the "ld" run that
  6680. creates the shared library resolves the reference:
  6681.  
  6682.         XtFoo() -> vendorShellClassRec
  6683.  
  6684. Then I create the Motif library that has its own vendorShellClassRec and an
  6685. XmBar() function that uses it; libXm will also contain a resolved reference to
  6686. vendorShellClassRec:
  6687.  
  6688.         XmBar() -> vendorShellClassRec
  6689.  
  6690. Finally, I link a program that uses both XtFoo() and XmBar() and the program
  6691. will end up with _two_ independent "vendorShellClassRec"s:
  6692.  
  6693.         XtFoo() -> vendorShellClassRec [Xt version]
  6694.         XmBar() -> vendorShellClassRec [Xm version]
  6695.  
  6696. Instant schizo zaphod mode.  In reality, vendorShellClassRec is not referenced
  6697. from functions but from other widget class records.
  6698.  
  6699. I can't just pull Vendor.o out from the shared Xt (Vendor.o appears to define
  6700. the only external symbols redefined by libXm) because AIX shared libraries
  6701. apparently can't contain unresolved external references.  If I take out
  6702. Vendor.o I have to take out every other file that uses symbols defined there -
  6703. and then files that need those files, etc.  I tried it and ended up with three
  6704. or four object files in libXt and the res non-sharable.
  6705.  
  6706. I kludged around this by putting all of libXt (minus Vendor.o) into the shared
  6707. libXm.  It isn't a pretty solution but it works - and beats having a
  6708. statically linked two-megabyte "periodic" demo...
  6709.  
  6710.  
  6711. -----------------------------------------------------------------------------
  6712. Subject: 161)  What is the error  "Unaligned access in XmString" under Ultrix?
  6713.  
  6714. Answer: Compile  XmString.c with STRINGS_ALIGNED.
  6715.  
  6716. -----------------------------------------------------------------------------
  6717. Subject: 162)  TOPIC: KEYSYMS
  6718.  
  6719. -----------------------------------------------------------------------------
  6720. Subject: 163)  What is causing the messages "unknown keysym osfDown..."?  It
  6721. happens when I run an application under Motif 1.1
  6722.  
  6723. Answer: There is an OSF supplied addition to the /usr/lib/X11/XKeysymDB file.
  6724. It is found on the release tape and should have been automatically installed
  6725. if the installation procedure was followed in the Release Notes.
  6726.  
  6727. You have to copy (or append) lib/Xm/XKeysymDB into /usr/lib/X11.  This may
  6728. require root permission.  It is not clear how to fix the problem if you can't
  6729. do this.  The error comes from Xt translation table parsing and can't be fixed
  6730. in Motif, so if you can't get root permission you may be stuck.  The file is
  6731. not copyrighted so you can install it on other systems.
  6732.  
  6733. If X has been built so that XKeysymDB is not in this directory, and you don't
  6734. know where it is looking, run 'strings libX11.a | grep XKeysymDB' to find the
  6735. path.
  6736.  
  6737. On a Sun running openwin with shared libraries, you may need to put the path
  6738. for the library containing XKeysymDB *first* in the path list in
  6739. LD_LIBRARY_PATH, or it may find the wrong XKeysymDB in the wrong directory.
  6740.  
  6741. XKeysymDB simply contains the registered keysym values for the OSF keysyms.
  6742. The OSF values are server-independent.  And, all registered keysyms will be
  6743. included in an XKeysymDB file to be shipped with X11R5.
  6744.  
  6745. In the meantime (till all systems are X11R5+), a list of the registered
  6746. keysyms can be found in the X11R4 release in mit/doc/Registry/Xregistry.
  6747.  
  6748. Also note the XKEYSYMDB environment variable. Setting this to point to the
  6749. XKeysymDB file often helps, but not always...
  6750.  
  6751.  
  6752. -----------------------------------------------------------------------------
  6753. Subject: 164)  What happens if I can't install Motif Keysyms?
  6754.  
  6755. From: tessi!george@nosun.West.Sun.COM (George Mitchell)
  6756.  
  6757. Here's what appears to happen if you don't have XKeysymDB in place to define
  6758. OSF's virtual keysyms:
  6759.  
  6760. 1. At class initialize time, for a widget (such as XmText) that uses virtual
  6761. keysyms in its event translation table, all entries which refer to those
  6762. keysyms fail to parse correctly.  In the case of XmText, instead of ending up
  6763. with a translation table with roughly 90 entries, you end up with one that has
  6764. 29.
  6765.  
  6766. 2. XKeysymDB doesn't exist, so you'd assume that KeyPress events will get
  6767. translated to plain vanilla keysyms, right?  WRONG!  All Motif widgets install
  6768. a virtual keysym translator ANYWAY!  Consequently, the backspace key (for
  6769. example) gets translated to the keysym osfBackSpace.
  6770.  
  6771. 3. Therefore, if you augment or override your widget's translations with
  6772. translations that refer to plain vanilla BackSpace, they will never be
  6773. triggered, because you will NEVER see plain vanilla BackSpace, only
  6774. osfBackSpace.
  6775.  
  6776. 4. But you can't use osfBackSpace in an event translation entry, because you
  6777. don't have XKeysymDB installed!
  6778.  
  6779. Here's how I'm "dealing" with the problem right now: Motif installs its
  6780. virtual keysym translator by calling XtSetKeyTranslator every time a
  6781. VendorShell (or subclass) widget is created.  So every time I create a shell,
  6782. I immediately call XtSetKeyTranslator (display, XtTranslateKey) to restore the
  6783. default translator.  No more funny virtual keysyms!  Now I can reinstall non-
  6784. osfKeySym translations and have them work the way I expect.
  6785.  
  6786.  
  6787. -----------------------------------------------------------------------------
  6788. Subject: 165)  Why has OSF introduced Keysyms into Motif 1.1?  They weren't
  6789. there in Motif 1.0.
  6790.  
  6791. Answer: From: ellis@osf.org
  6792.  
  6793. Virtual Keysyms are meant to provide a consistent keyboard model for Motif
  6794. applications running in a heterogeneous environment in which proprietary (i.e.
  6795. vendor specific) non-Motif applications may also be running.
  6796.  
  6797. First of all, for the sake of the rest of the readers, let's explain why this
  6798. is an issue:
  6799.  
  6800. It would be lovely if Motif's translation tables could just use the obvious
  6801. keysyms predefined by X.  For example, there are keysyms for XK_BackSpace,
  6802. XK_Delete, XK_Left, XK_Right, etc.  Shouldn't these be the ones that are used
  6803. in our translations?  Unfortunately, the problem is not so simple.  Some
  6804. specific examples:
  6805.  
  6806.    While most vendors bind XK_BackSpace to the key at the top right
  6807.    of the standard keyboard (often engraved with a leftwards
  6808.    pointing arrow), not all do.  In fact, some vendors (including DEC)
  6809.    bind that key to XK_Delete.
  6810.  
  6811.    While most vendors bind the arrow keys to XK_Up, etc, a number of
  6812.    vendors (including Sun, on some servers) bind them to function key
  6813.    keysyms.
  6814.  
  6815. A simplistic solution would require the use of xmodmap to change the offending
  6816. bindings.  That would work swell in an all Motif environment.  However, OSF's
  6817. goal (not always perfectly achieved) is interoperability.  That is, we'd like
  6818. to make sure that both Motif and non-Motif programs can happily run in the
  6819. same environment.
  6820.  
  6821. It is expected that a vendor may have a wide variety of existing X-based
  6822. software that uses the keysyms as established by that vendor for specific
  6823. purposes.  It is expected that these applications may run at the same time as
  6824. Motif-based software.  Using xmodmap to change keysyms on the server side
  6825. could "break" the existing applications (or at the very least their
  6826. documentation) by making some keys unavailable, or by moving the location.
  6827.  
  6828. So, we chose not to use xmodmap.  By the way, though OpenLook uses a different
  6829. implementation (they recompile their virtual translation tables into actual
  6830. translation tables), they basically adopted the same approach, presumably for
  6831. similar reasons.
  6832.  
  6833. To work properly, the virtual keysym model we implemented depends on Xlib
  6834. finding XKeysymDB installed appropriately (which standard Motif installation
  6835. does).  This simply defines the keysyms (not the key they are bound to).  This
  6836. unfortunate piece of stupidity is necessary because MIT only includes standard
  6837. keysyms in keysymdef.h.  It should be said that our lives would be made easier
  6838. if MIT would also see fit to include registered keysyms in keysymdef.h as
  6839. well.
  6840.  
  6841. Motif applications determine how to bind virtual to actual keys by looking for
  6842. either a resource or a property on the root window which describes what to do.
  6843. Note that this information is on the server side, so that all applications use
  6844. the same virtual bindings regardless of where they are running.  Mwm will
  6845. happily create the property if it finds a .motifbind file in your home
  6846. directory when it starts up.  (Actually, things generally work even if none of
  6847. this is done, since if all else fails, the Motif toolkit chooses a virtual
  6848. bindings table to use based on the identification of the server).
  6849.  
  6850. The actual implementation of virtual keys is made possible by a hook in the
  6851. Intrinsics.  Undoubtably, the implementation would be simpler and cleaner if
  6852. virtual key support was more directly supported by the Intrinsics.  We will be
  6853. exploring this possibility in the future.
  6854.  
  6855.   -- Ellis
  6856.  
  6857. -----------------------------------------------------------------------------
  6858. Subject: 166)+ Why do accented characters not work with Motif applications
  6859. linked with X11R6? What is the Compose file?
  6860.  
  6861. [Last modified: Feb 95]
  6862.  
  6863. Answer: Roman Czyborra (czyborra@cs.tu-berlin.de) writes:
  6864.  
  6865. I've xmodmapped a few accented characters onto my keyboard. They've worked
  6866. fine in most every window, but were dead in the Motif applications linked with
  6867. X11R6.  My LC_CTYPE has always been set to iso_8859_1, so that was not the
  6868. problem.  It turns out that I can activate the keys by patching
  6869. $XLOCALEDIR/iso8859-1/Compose to also include the lines listed below. I
  6870. couldn't find any documentation on the Compose file. Please include this in
  6871. the next release and the Motif FAQ.
  6872.  
  6873. <nobreakspace>          : "240"
  6874. <exclamdown>            : "241"
  6875. <cent>                  : "242"
  6876. <sterling>              : "243"
  6877. <currency>              : "244"
  6878. <yen>                   : "245"
  6879. <brokenbar>             : "246"
  6880. <section>               : "247"
  6881. <diaeresis>             : "250"
  6882. <copyright>             : "251"
  6883. <ordfeminine>           : "252"
  6884. <guillemotleft>         : "253"
  6885. <notsign>               : "255"
  6886. <hyphen>                : "255"
  6887. <registered>            : "256"
  6888. <macron>                : "257"
  6889. <degree>                : "260"
  6890. <plusminus>             : "261"
  6891. <twosuperior>           : "262"
  6892. <threesuperior>         : "263"
  6893. <acute>                 : "264
  6894. <mu>                    : "265"
  6895. <paragraph>             : "266"
  6896. <periodcentered>        : "267"
  6897. <cedilla>               : "240"
  6898. <onesuperior>           : "271"
  6899. <masculine>             : "272"
  6900. <guillemotright>        : "273"
  6901. <onequarter>            : "274"
  6902. <onehalf>               : "275"
  6903. <threequarters>         : "276"
  6904. <questiondown>          : "277"
  6905. <Agrave>                : "300"
  6906. <Aacute>                : "301"
  6907. <Acircumflex>           : "302"
  6908. <Atilde>                : "303"
  6909. <Adiaeresis>            : "304"
  6910. <Aring>                 : "305"
  6911. <AE>                    : "306"
  6912. <Ccedilla>              : "307"
  6913. <Egrave>                : "310"
  6914. <Eacute>                : "311"
  6915. <Ecircumflex>           : "312"
  6916. <Ediaeresis>            : "313"
  6917. <Igrave>                : "314"
  6918. <Iacute>                : "315"
  6919. <Icircumflex>           : "316"
  6920. <Idiaeresis>            : "317"
  6921. <ETH>                   : "320"
  6922. <Ntilde>                : "321"
  6923. <Ograve>                : "322"
  6924. <Oacute>                : "323"
  6925. <Ocircumflex>           : "324"
  6926. <Otilde>                : "325"
  6927. <Odiaeresis>            : "326"
  6928. <multiply>              : "327"
  6929. <Ooblique>              : "330"
  6930. <Ugrave>                : "331"
  6931. <Uacute>                : "332"
  6932. <Ucircumflex>           : "333"
  6933. <Udiaeresis>            : "334"
  6934. <Yacute>                : "335"
  6935. <THORN>                 : "336"
  6936. <ssharp>                : "337"
  6937. <agrave>                : "340"
  6938. <aacute>                : "341"
  6939. <acircumflex>           : "342"
  6940. <atilde>                : "343"
  6941. <adiaeresis>            : "344"
  6942. <aring>                 : "345"
  6943. <ae>                    : "346"
  6944. <ccedilla>              : "347"
  6945. <egrave>                : "350"
  6946. <eacute>                : "351"
  6947. <ecircumflex>           : "352"
  6948. <ediaeresis>            : "353"
  6949. <igrave>                : "354"
  6950. <iacute>                : "355"
  6951. <icircumflex>           : "356"
  6952. <idiaeresis>            : "357"
  6953. <eth>                   : "360"
  6954. <ntilde>                : "361"
  6955. <ograve>                : "362"
  6956. <oacute>                : "363"
  6957. <ocircumflex>           : "364"
  6958. <otilde>                : "365"
  6959. <odiaeresis>            : "366"
  6960. <division>              : "367"
  6961. <oslash>                : "370"
  6962. <ugrave>                : "371"
  6963. <uacute>                : "372"
  6964. <ucircumflex>           : "373"
  6965. <udiaeresis>            : "374"
  6966. <yacute>                : "375"
  6967. <thorn>                 : "376"
  6968. <ydiaeresis>            : "377"
  6969.  
  6970. -----------------------------------------------------------------------------
  6971. Subject: 167)  TOPIC: UIL
  6972.  
  6973. [NOTE: As you can see, this is a new topic area. Send me your ideas for
  6974. answered questions pertaining to this topic.]
  6975.  
  6976. -----------------------------------------------------------------------------
  6977. Subject: 168)  What is UIL and why is it so popular?
  6978.  
  6979. [Last modified: Sept 94]
  6980.  
  6981. Answer:
  6982.  
  6983. UIL is the acronym for "User Interface Language", a Motif standard which
  6984. permits separation of the user interface from application code.  UIL is a
  6985. textual description of the user interface which is compiled into binary form
  6986. called UID ("User Interface Definition") using the Motif-provided compiler
  6987. called "uil".
  6988.  
  6989. It is important to realize that UIL is a static description of the UI in that
  6990. connections between buttons and the dialogs they invoke, for example, is not
  6991. expressed here; dynamic UI behavior appears in C code.
  6992.  
  6993. The Period Table of Widgets, called "periodic" (delivered by many Motif
  6994. vendors) is an example of a UIL application.
  6995.  
  6996. There are many advantages and disadvantages of UIL applications.  A few of the
  6997. advantages are:
  6998.  
  6999.     UIL is a standard format which encourages separation of the
  7000.     user interface from application code.
  7001.  
  7002.     UIL can be read and/or written by many of the GUI builders and UIMS
  7003.     tools mentioned elsewhere in this FAQ, making your interface portable
  7004.     (to a degree) across builder tools.
  7005.  
  7006.     UIL is a much better language than C for defining a widget
  7007.     hierarchy: in C, the widget hierarchy is expressed "linearly"
  7008.     by referencing a previously-created parent widget when creating
  7009.     a child widget; in UIL, widget trees are defined more naturally
  7010.     using nesting.
  7011.  
  7012.     With UIL, you separate the definition of the widget tree from
  7013.     the application.  You can make major changes to the look-and-feel
  7014.     without re-building the application.
  7015.  
  7016.     It is possible to write a "general-purpose" application that defines
  7017.     a library of callbacks.  The application may "execute" any UIL file
  7018.     that references callbacks from the library.
  7019.  
  7020.  
  7021. For a good UIL reference, see "Motif Programming Manual", Volume 6A, published
  7022. by O'Reilly and Associates. [See "BOOKS" for details.]
  7023.  
  7024. -----------------------------------------------------------------------------
  7025. Subject: 169)  What is Mrm?
  7026.  
  7027. [Last modified: Nov 94]
  7028.  
  7029. Answer: Mrm is the "Motif Resource Manager", a set of functions (whose names
  7030. begin with Mrm, such as MrmFetchWidget and MrmRegisterNames) in libMrm.a which
  7031. retrieve the widget hierarchy from the UID file, associate callbacks, and
  7032. create the widgets.
  7033.  
  7034. Mrm is usually discussed in books which cover UIL.
  7035.  
  7036.     Motif Programming Manual, Volume 6A
  7037.     OSF/Motif Programmers Guide
  7038.     OSF/Motif Programmers Reference Manual
  7039.  
  7040. See the BOOKS section for detailed references.
  7041.  
  7042. -----------------------------------------------------------------------------
  7043. Subject: 170)  How do I specify a search path for ".uid" files?  Answer: Use
  7044. the UIDPATH environment variable.  It is documented on the MrmOpenHierarchy()
  7045. man page.
  7046.  
  7047. -----------------------------------------------------------------------------
  7048. Subject: 171)  Can I specify callback functions in resource files?
  7049.  
  7050. Answer: To specify callbacks, you must use UIL in addition to or in place of
  7051. resource files.  You can, however, specify translations in resource files,
  7052. which give you most of the same functionality as callback functions.
  7053.  
  7054. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  7055.  
  7056. -----------------------------------------------------------------------------
  7057. Subject: 172)  How can I set a multiline label in UIL?
  7058.  
  7059. [Last modified: Sept 94]
  7060.  
  7061. Answer: In UIL, you have to explicitly create a compound string with a
  7062. separator.  Here's what W. Scott Meeks suggests:
  7063.  
  7064. value nl : compound_string('', seperate=true);
  7065.  
  7066. object my_label : XmLabel
  7067. {
  7068.     arguments
  7069.     {
  7070.         XmNlabelString = 'Here' & nl & 'is' & nl & 'the' & nl & 'Label';
  7071.     };
  7072. };
  7073.  
  7074.  
  7075. -----------------------------------------------------------------------------
  7076. Subject: 173)  Is there a program that can convert a UIL file to tclMotif?  I
  7077. have an old Motif program that I used on SCO unix. Now that I switched to
  7078. Linux, I would like to "reprogram" it without the Motif libraries under Linux.
  7079.  
  7080. [Last modified: Dec 94]
  7081.  
  7082. Answer: Jan Newmarch (jan@ise.canberra.edu.au) writes:
  7083.  
  7084. The latest version of tclMotif (v 1.3) will allow you to load uil files
  7085. (actually, the uid files output from the uil compiler) directly into tclMotif.
  7086. So you don't need to convert at all.
  7087.  
  7088. The source is available at ftp.x.org. This, plus a Linux binary are also at
  7089. ftp://ftp.canberra.edu/pub/motif/tclMotif
  7090.  
  7091.  
  7092. -----------------------------------------------------------------------------
  7093. Subject: 174)  TOPIC: ICONIFICATION and DE-ICONIFICATION
  7094.  
  7095. Iconification/de-iconification is a co-operative process between a client and
  7096. a window manager.  The relevant standards are set by ICCCM.  Mwm is ICCCM
  7097. compliant.  The toplevel (non-override-redirect) windows of an application may
  7098. be in three states: WithdrawnState (neither the window nor icon visible),
  7099. NormalState (the window visible) or IconicState (the icon window or pixmap
  7100. visible).  This information is contained in the WM_STATE property but ordinary
  7101. clients are not supposed to look at that (its values have not yet been
  7102. standardised).  Movement between the three states is standardised by ICCCM.
  7103.  
  7104. -----------------------------------------------------------------------------
  7105. Subject: 175)  How can I keep track of changes to iconic/normal window state?
  7106.  
  7107. Answer: You can look at the WM_STATE property, but this breaks ICCCM
  7108. guidelines.  ICCCM compliant window managers will map windows in changing them
  7109. to normal state and unmap them in changing them to iconic state. Look for
  7110. StructureNotify events and check the event type:
  7111.  
  7112.         XtAddEventHandler (toplevel_widget,
  7113.                         StructureNotifyMask,
  7114.                         False,
  7115.                         StateWatcher,
  7116.                         (Opaque) NULL);
  7117.         ....
  7118.         void StateWatcher (w, unused, event)
  7119.         Widget w;
  7120.         caddr_t unused;
  7121.         XEvent *event;
  7122.         {
  7123.                 if (event->type == MapNotify)
  7124.                         printf ("normal\n");
  7125.                 else if (event->type == UnmapNotify)
  7126.                         printf ("iconified\n");
  7127.                 else    printf ("other event\n");
  7128.         }
  7129.  
  7130.  
  7131. If you insist on looking at WM_STATE, here is some code (from Ken Sall) to do
  7132. it:
  7133.  
  7134.         /*
  7135.         ------------------------------------------------------------------
  7136.         Try a function such as CheckWinMgrState below which returns one of
  7137.         IconicState | NormalState | WithdrawnState | NULL :
  7138.         ------------------------------------------------------------------
  7139.         */
  7140.         #define WM_STATE_ELEMENTS 1
  7141.  
  7142.         unsigned long *CheckWinMgrState (dpy, window)
  7143.         Display *dpy;
  7144.         Window window;
  7145.         {
  7146.           unsigned long *property = NULL;
  7147.           unsigned long nitems;
  7148.           unsigned long leftover;
  7149.           Atom xa_WM_STATE, actual_type;
  7150.           int actual_format;
  7151.           int status;
  7152.  
  7153.             xa_WM_STATE = XInternAtom (dpy, "WM_STATE", False);
  7154.  
  7155.             status = XGetWindowProperty (dpy, window,
  7156.                           xa_WM_STATE, 0L, WM_STATE_ELEMENTS,
  7157.                           False, xa_WM_STATE, &actual_type, &actual_format,
  7158.                           &nitems, &leftover, (unsigned char **)&property);
  7159.  
  7160.             if ( ! ((status == Success) &&
  7161.                         (actual_type == xa_WM_STATE) &&
  7162.                         (nitems == WM_STATE_ELEMENTS)))
  7163.                 {
  7164.                 if (property)
  7165.                     {
  7166.                     XFree ((char *)property);
  7167.                     property = NULL;
  7168.                     }
  7169.                 }
  7170.             return (property);
  7171.         } /* end CheckWinMgrState */
  7172.  
  7173.  
  7174. One problem with testing WM_STATE is that a race condition is possible;
  7175. immediately after testing it, it could change, and the logic proceeds to
  7176. behave as if it were in the old state.
  7177.  
  7178. -----------------------------------------------------------------------------
  7179. Subject: 176)  How can I check if my application has come up iconic?  I want
  7180. to delay initialization code and other processing.
  7181.  
  7182. Answer: Use XtGetValues and check for the XmNinitialState value of the
  7183. toplevel shell just before XtMainLoop. -- IconicState is iconic, NormalState
  7184. is not iconic.
  7185.  
  7186.  
  7187. -----------------------------------------------------------------------------
  7188. Subject: 177)  How can I start my application in iconic state?
  7189.  
  7190. Answer: From the command line
  7191.  
  7192.         application -iconic
  7193.  
  7194. Using the resource mechanism, set the resource XmNinitialState to IconicState
  7195. of the toplevel shell widget (the one returned from XtInitialise).
  7196.  
  7197. -----------------------------------------------------------------------------
  7198. Subject: 178)  How can an application iconify itself?
  7199.  
  7200. Answer: In R4 and later, use the call XIconifyWindow.
  7201.  
  7202. For R3, send an event to the root window with a type of WM_CHANGE_STATE and
  7203. data IconicState.
  7204.  
  7205.         void
  7206.         IconifyMe (dpy, win)
  7207.         Display *dpy;
  7208.         Window win;     /* toplevel window to iconify */
  7209.         {
  7210.                 Atom xa_WM_CHANGE_STATE;
  7211.                 XClientMessageEvent ev;
  7212.  
  7213.                 xa_WM_CHANGE_STATE = XInternAtom (dpy,
  7214.                                         "WM_CHANGE_STATE", False);
  7215.  
  7216.                 ev.type = ClientMessage;
  7217.                 ev.display = dpy;
  7218.                 ev.message_type = xa_WM_CHANGE_STATE;
  7219.                 ev.format = 32;
  7220.                 ev.data.l[0] = IconicState;
  7221.                 ev.window = win;
  7222.  
  7223.                 XSendEvent (dpy,
  7224.                         RootWindow (dpy, DefaultScreen(dpy)),
  7225.                         True,
  7226.                         (SubstructureRedirectMask | SubstructureNotifyMask),
  7227.                         &ev);
  7228.                 XFlush (dpy);
  7229.         }
  7230.  
  7231.  
  7232. -----------------------------------------------------------------------------
  7233. Subject: 179)  How can an application de-iconify itself?
  7234.  
  7235. Answer: XMapWindow (XtDisplay (toplevel_widget), XtWindow (toplevel_widget)).
  7236.  
  7237. -----------------------------------------------------------------------------
  7238. Subject: 180)* TOPIC: SPECIALIZED WIDGETS
  7239.  
  7240. [Last modified: Jan 95]
  7241.  
  7242. This section describes a few specialized widgets people have asked about.  A
  7243. _far_ more comprehensive illustrated list is maintained by John L. Cwikla
  7244. (cwikla@wri.com).  His list covers these widget categories:
  7245.  
  7246.         Complete Listing
  7247.         Composite Widgets
  7248.         Non-Composite Widgets
  7249.         Motif 1.1 Compatible
  7250.         Motif 1.2 Compatible
  7251.         Athena Compatible
  7252.         FWF Widget Set
  7253.         By Author
  7254.         Shareware Widgets
  7255.         Commercial Widgets
  7256.  
  7257. For John L. Cwikla's Widget FAQ Home Page, WWW users should see:
  7258.  
  7259.         http://www.wri.com/~cwikla/widget.html
  7260.  
  7261. The Widget FAQ is also available in ASCII as:
  7262.  
  7263.         ftp://ftp.x.org/contrib/faqs/Widget.FAQ.Z
  7264.  
  7265. The Widget FAQ contains a listing of widgets:
  7266.  
  7267.         http://www.wri.com/~cwikla/cats/listing.html
  7268.  
  7269. If you don't have access to the World Wide Web, Cwikla's Widget FAQ (sans
  7270. pictures) can be obtained from ftp.x.org:
  7271.  
  7272.         /contrib/faqs/Widget.FAQ.Z
  7273.  
  7274.  
  7275. -----------------------------------------------------------------------------
  7276. Subject: 181)  Where can I get a Table widget? Matrix widget? Spreadsheet
  7277. widget?
  7278.  
  7279. [Last modified: Sept 94]
  7280.  
  7281.  
  7282. Answer: Kee Hinckley (now: nazgul@utopia.com) recently informed this FAQ
  7283. maintainer that he will put the Table widget on ftp at ftp.utopia.com
  7284. _approximately_ at the end of September or early October, 1994. He is in the
  7285. process of addressing some issues concerning Motif 1.2 and higher with respect
  7286. to the Table widget.  The Widget Creation Library (Wcl) also has a version of
  7287. the Table widget.
  7288.  
  7289. In the Xbae README, Andrew Wason (aw@bae.bellcore.com) writes: XbaeMatrix is a
  7290. Motif widget which presents an editable array of string data to the user in a
  7291. scrollable table similar to a spreadsheet. The rows and columns of the Matrix
  7292. may optionally be labeled. Also, a number of "fixed" leading rows or columns
  7293. may be specified - these behave similarly to the labels. While XbaeMatrix
  7294. looks and acts like a grid of XmTextField widgets, it actually contains only
  7295. one XmTextField.  This means that XbaeMatrix widgets with hundreds or
  7296. thousands of rows have much less overhead than they would if they used an
  7297. XmTextField for each cell. XbaeMatrix has callbacks for doing field validation
  7298. and customizing traversal. It allows cells to be assigned independent colors.
  7299. It allows rows, columns and regions of cells to be selected (highlighted).
  7300. The matrix can be dynamically grown or shrunk by adding and deleting rows and
  7301. columns at any position.
  7302.  
  7303. For Xbae code and documentation via ftp, see the various files
  7304. ftp.x.org:/contrib/widgets/motif/Xbae-*.
  7305.  
  7306.  
  7307. Expert Database Systems, Inc., 377 Rector Place, Suite 3L New York, NY 10280.
  7308. Phone: (212) 783-6981 has a very comprehensive table widget that uses both
  7309. Motif scrollbars or a "virtual" scrollbar showing a miniature version of the
  7310. entire spreadsheet. Allows for different width columns, changing colors in
  7311. each cell.  Only one X-Window is used so as to reduce the amount of system
  7312. resources used.  Contact Ken Jones email: ken@mr_magoo.sbi.com)
  7313.  
  7314.  
  7315. -----------------------------------------------------------------------------
  7316. Subject: 182)  Where can I get a bar graph widget?
  7317. [Last modified: Sept 94]
  7318.  
  7319. Answer: You can fake one by using for each bar a scroll bar or even a label
  7320. which changes in size, put inside a container of some kind.
  7321.  
  7322. Try the StripChart widget in the Athena widget set. Set the XtNupdate resource
  7323. to 0 to keep it from automatically updating.
  7324.  
  7325. The comp.windows.x FAQ mentions a bar graph widget.
  7326.  
  7327. Expert Database Systems, Inc.  sells a bar graph widget as well as a multi-
  7328. line graph with automatic scaling, a 3-D surface graph, and a high/Low graph
  7329. with two lines for moving averages.  Contact Ken Jones Expert Database
  7330. Systems, Inc., 377 Rector Place, Suite 3L New York, NY 10280.  Phone: (212)
  7331. 783-6981
  7332.  
  7333.  
  7334. The Xtra XWidget library contains a set of widgets that are subclassed from
  7335. and compatible with either OSF/Motif or OLIT widgets.  The library includes
  7336. widgets that implement the following:
  7337.  
  7338.    Spreadsheet
  7339.    Bar Graph
  7340.    Stacked Bar Graph
  7341.    Line Graph
  7342.    Pie Chart
  7343.    XY Plot
  7344.    Hypertext
  7345.    Hypertext based Help System
  7346.    Entry Form with type checking
  7347.  
  7348. Contact Graphical Software Technology at 310-328-9338  (info@gst.com) for
  7349. information.
  7350.  
  7351. The XRT/graph widget, available for Motif, XView and OLIT, displays X-Y plots,
  7352. bar and pie charts, and supports user-feedback, fast updates and PostScript
  7353. output. Contact KL Group Inc. at 416-594-1026 (xrt_info%klg@uunet.ca)
  7354.  
  7355. The product Xmath, made by Integrated Systems Inc. is a product which has
  7356. interactive 2d and 3d graphics for bar,strip,line,symbol,
  7357. surface,contour,etc... that costs $2500.00 for commercial use and a mere
  7358. $250.00 for university use that also has complete numerics capabilities, an
  7359. easy to use debugger, a complete high level language, a spreadsheet, a motif
  7360. gui access capability, and much more all created on top of motif.
  7361.  
  7362. You can either email to xmath-info@isi.com or call (408)980-1500.
  7363.  
  7364. Digital Equipment Corporation (DEC) provides the following product NetEd: "The
  7365. network editor widget is a Motif toolkit conforming widget that applications
  7366. can use to express complex interrelationships graphically in the form of
  7367. networks or graphs. The network editor supports interactive or application-
  7368. controlled creation and editing of directed graphs or networks."
  7369.  
  7370.  
  7371. ACE/gr is an X based XY plotting tool implemented with a point 'n click
  7372. paradigm.  A few of its features are:
  7373.  
  7374.    * Plots up to 10 graphs with 30 data sets per graph.
  7375.    * Data read from files and/or pipes.
  7376.    * Graph types XY, log-linear, linear-log, log-log, bar,
  7377.         stacked bar charts.
  7378.  
  7379. it is available from
  7380.  
  7381.         ftp.ccalmr.ogi.edu (presently amb4.ccalmr.ogi.edu)
  7382.  
  7383. with IP address 129.95.72.34. The XView version (xvgr) will be found in
  7384. /CCALMR/pub/acegr/xvgr-2.09.tar.Z and the Motif version (xmgr) in
  7385. /CCALMR/pub/acegr/xmgr-2.09.tar.Z.  Comments, suggestions, bug reports to
  7386. pturner@amb4.ccalmr.ogi.edu (if mail fails, try pturner@ese.ogi.edu). Due to
  7387. time constraints, replies will be few and far between.
  7388.  
  7389. Caterpillar, Inc. sells the ENGOTS (Engineering Graphic Object Tool Set)
  7390. widget set for Motif.  The library includes interactive plotting, built in
  7391. units conversion, copy-cut-past, postscript output, ... :
  7392.  
  7393.  
  7394.     XY/contour Plot (configurable to Bar plots)
  7395.     XY/contour Strip Charts
  7396.     Polar Plot
  7397.     Custom Interactive Drawing (using provided Drawing Package)
  7398.     float/int data entry (Motif Text "Look and Feel") with range checking
  7399.  
  7400.  
  7401. Contact Paul Mauschbaugh, Caterpillar, Inc. at 309-578-4084 (mush@cat.com) for
  7402. more information.
  7403.  
  7404. -----------------------------------------------------------------------------
  7405. Subject: 183)  Is there a graph widget in which you can add vertices and edges
  7406. and get automatic updating?
  7407.  
  7408. [Last modified: March 93]
  7409.  
  7410. Answer: The XUG FAQ in comp.windows.x includes information on graph display
  7411. widgets.  There is also an implementation in the Asente/Swick book.
  7412.  
  7413.   From Martin Janzen: "You could have a look at DataViews, from V.I.
  7414.    Corporation.  This package is used mainly to display a variety of graph
  7415.    drawings (eg. bar, line, pie, high/low, and other charts), and to update
  7416.    the graphs as information is received from "data sources" such as files,
  7417.    processes (through pipes), or devices.
  7418.  
  7419.    However, it also provides "node" and "edge" objects which can be used
  7420.    when working with network graphs.  The DV-Tools function library
  7421.    provides routines which traverse a graph, count visits to each node or
  7422.    edge, mark nodes or edges of interest, and so on.  A node or edge object
  7423.    can have an associated "geometry object" (such as a symbol or a line),
  7424.    which represents that node or edge.
  7425.  
  7426.    Drawbacks: There's no automatic positioning algorithm; when you add a
  7427.    node or edge, you have to create and position its geometry object
  7428.    yourself.  Also, this isn't a set of add-on widgets; you can either have
  7429.    DataViews create an X window (ie. a separate shell), or you can create
  7430.    your own XmDrawingArea and use DataViews to update its window when
  7431.    expose events are received.  Finally, the package is quite expensive,
  7432.    and there is a run-time charge.
  7433.  
  7434.    The vendor's address is:
  7435.      V.I. Corporation,
  7436.      47 Pleasant Street,
  7437.      Northampton, MA  01060,
  7438.             Email: vi@vicorp.com, Phone: (413) 586-4144, Fax:   (413) 584-2649
  7439.  
  7440.    or
  7441.  
  7442.      V.I. Corporation (Europe) Ltd.,
  7443.      First Base, Beacontree Plaza,
  7444.      Gillette Way,                      Email: viesales@eurovi.uucp
  7445.      Reading, Berkshire  RG2 0BP"
  7446.    Phone: +44 734 756010,      Fax:   +44 734 756104
  7447.  
  7448. From Craig Timmerman: Just wanted others to know that there is a third
  7449. competitor in what may be come a big market for generic APIs.  The product is
  7450. called Open Interface and Neuron Data is the vendor.  Neuron has added some
  7451. extra, more complex widgets to their set.  The two most notable are a table
  7452. and network widget.  [...] I believe that the network widget got its name from
  7453. its ability to display expert system networks that Neuron's AI tools needed.
  7454. It would be more aptly named the graph widget.  It can display and manipulate
  7455. graphs of various types (trees, directed graphs, etc).  Contact is
  7456.  
  7457.         Neuron Data
  7458.         156 University Avenue
  7459.         Palo Alto,  CA  94301
  7460.         (415) 321-4488
  7461.  
  7462.  
  7463. prism!gt3273b@gatech.edu  (RENALDS,ANDREW THEODORE) posted a set of public
  7464. domain routines for graph drawing.  Contact him for a later set.
  7465.  
  7466. From Ramon Santiago (santiago@fgssu1.fgs.slb.com): HP has released source code
  7467. for XmGraph and XmArc, part of the InterWorks library, which does exactly
  7468. this. The sources can be obtained by contacting Dave Shaw,
  7469. librarian@iworks.ecn.uiowa.edu. A few trivial source code changes need to be
  7470. made to get these widgets to compile under Motif 1.2.
  7471.  
  7472. Free DAG - directed acyclic graph drawing software in motif environment is
  7473. available. Please send a note to address below if you want it:
  7474.  
  7475. Budak Arpinar, TUBITAK Software Research & Development Center, Ankara,
  7476. TURKIYE, E-mail : C51881@TRMETU.BITNET
  7477.  
  7478.  
  7479. -----------------------------------------------------------------------------
  7480. Subject: 184)* Is there a help system available, such as in Windows 3?  Is
  7481. there a Motif based hypertext system?
  7482.  
  7483. [Last modified: Feb 95]
  7484.  
  7485. Answer: There are many hypertext-like help systems.
  7486.  
  7487. HTML Widget from NCSA:
  7488.  
  7489. The NCSA Mosaic for X package contains an HTML widget which is freely
  7490. available and is the main vehicle for viewing HTML documents in the Mosaic
  7491. program. It has callbacks for anchor hits, selections, etc and many many
  7492. resources for customizing the viewing area of your hypertext documents.  See
  7493. "Where can I get the HTML widget" above.
  7494.  
  7495. GWHIS:
  7496.  
  7497. There is a new product from Quadralay Corporation, called the Global-Wide Help
  7498. & Information Systems (GWHIS).
  7499.  
  7500. from a press release: AUSTIN, TX (March 3, 1994) Quadralay Corporation today
  7501. announced its newest software development tool, Global Wide Help & Information
  7502. System (GWHIS).  GWHIS allows third party application developers to add online
  7503. documentation and context sensitive help to their applications like never
  7504. before.  This documentation may consist of plain text, rich format text,
  7505. hypertext, images, audio, and/or video animation and may easily be distributed
  7506. either locally or over a wide area network such as the Internet.
  7507.  
  7508. GWHIS consists of two primary components.  An application programming
  7509. interface (API), and a hypermedia viewer (based on technology licensed from
  7510. the NCSA Mosaic project).  Several ancillary conversion programs are also
  7511. available allowing end users to easily convert existing documentation into
  7512. GWHIS' native HTML format.
  7513.  
  7514. GWHIS is available on the following platforms: SPARC SunOS 4.1.x, SPARC
  7515. Solaris 2.x, INTEL SCO Open Desktop, INTEL Solaris 2.x, HP 9000/700, and the
  7516. RS/6000. Support for additional platforms (including MS Windows and Macintosh)
  7517. is under consideration.  Fully functional evaluation copies of this software
  7518. are available upon request or via anonymous ftp from ftp.quadralay.com.
  7519.  
  7520. Brian Combs Quadralay Corporation combs@quadralay.com
  7521.  
  7522.  
  7523. Bristol Technology have a hypertext system HyperHelp with the look-and-feel of
  7524. Motif.  HyperHelp 4.0 is available now and includes support for MIF, RTF (Word
  7525. 6.0) and SGML.  (The OpenLook look-and-feel is no longer supported).
  7526.  
  7527.         Bristol Technology, Inc.
  7528.         241 Ethan Allen Highway
  7529.         Ridgefield, CT  06877
  7530.         (203) 438-6969 (phone)
  7531.         (203) 438-5013 (fax)
  7532.         info@bristol.com
  7533.  
  7534. Demos are available by anonymous ftp from ftp.bristol.com (192.246.192.2) in
  7535. /pub/Demos/HyperHelp.
  7536.  
  7537. There was a posting of a motif hypertext-widget to comp.sources.x (Author:
  7538. B.Raoult ( mab@ecmwf.co.uk ) ).  It had the facility to read in helptext from
  7539. a file.
  7540.  
  7541. From Francois Felix Ingrand (felix@idefix.laas.fr): I have translated the Info
  7542. AW (originally written by Jordan Hubbard) to Motif. It is a Widget to browse
  7543. Info files (format used by GNU for their various documentations). I use it as
  7544. the help system of various tool I wrote.  It is available on laas.laas.fr
  7545. (140.93.0.15) in /pub/prs/xinfo-motif.tar.Z
  7546.  
  7547. Form Scott Raney (raney@metacard.com) MetaCard is a commercial package that
  7548. can be used to implement hypertext help.  The text fields support multiple
  7549. typefaces, sizes, styles, colors, subscript/superscript, and hypertext links.
  7550. It has a Motif interface, and a template for calling it from an Xt/Motif
  7551. application is included.  You can FTP a save-disabled distribution from
  7552. ftp.metacard.com or from world.std.com.  For more info, email to
  7553. info@metacard.com.
  7554.  
  7555.  
  7556. The Motifation GbR also provides a hypertext-helpsystem named 'XpgHelp'.
  7557. (Motif look-and-feel / features like those known from MS Windows Help )
  7558. Information about XpgHelp and a free demo version can be obtained via:
  7559. http://www.uni-paderborn.de/fachbereich/AG/szwillus/xpghelp/index.html
  7560.  
  7561. XpgHelp is distributed by:
  7562.  
  7563.            Motifation GbR
  7564.            Geroldstrasse 38
  7565.            33098 Paderborn
  7566.            Germany
  7567.            +49 (0) 5251 25633 (phone)
  7568.            email: griebel@uni-paderborn.de
  7569.  
  7570.  
  7571. XpgHelp has nearly the same features like HyperHelp: (multiple fonts, graphics
  7572. in b&w and color, different styles, tabs, links, short links, notepad, ...)
  7573.  
  7574. The Interface Builder MOTIFATION uses XpgHelp as its hypertext helpsystem.
  7575.  
  7576. -----------------------------------------------------------------------------
  7577. Subject: 185)  Is there a canvas widget or drawing widget for graphical
  7578. display?
  7579.  
  7580. [Last modified: Oct 94]
  7581.  
  7582. Answer: Groupe Bull - Koala Project has a Motif Canvas Widget.  This widget is
  7583. intended to provide graphical display (lines, rectangles, icons,...) and
  7584. direct manipulation services (select, move, resize,...) for Xt based
  7585. applications. This widget is intended to be include in a MOTIF application,
  7586. but you can generate an Athena widget (though demos are only using MOTIF). The
  7587. widget is shipped with an objects library based on a C object oriented model
  7588. called KLONE (use of the Xt object model would dramaticaly increase
  7589. application load time and KLONE provides garbage collection).  Features:
  7590.  
  7591. - uses an improved C small object-oriented model (garbage col. + polymorphism)
  7592. - multi-view: an object may be shared between two views (canvases)
  7593. - Multi-display: two views may be on different displays / screens
  7594. - double buffering for smooth animations
  7595. - easy to use "just know how to use widgets"
  7596. - small objects
  7597. - garbage collection
  7598. - Tag object to define graphical object appearance
  7599. - define tag's attributes with Xt resources
  7600. - dispatch mechanism uses Xt -> you can set Xt translations on a graphic obj
  7601. - Interactor objects to define a complete behavior
  7602. - unlimited Zoom / Unzoom
  7603. - classes: Line, Rect, Filled rect, Xpm Icon, Group, Ellipse, Anchor, Link
  7604. - mouse interactors: move, resize
  7605.  
  7606. Requirements: MOTIF, XPM
  7607.  
  7608. See http://zenon.inria.fr:8003/koala/koala.html and
  7609. ftp://avahi.inria.fr/pub/widgets/canvas-widget-1.7.tar.gz
  7610.  
  7611. Thanks to Jean-Michel.Leon@sophia.inria.fr.
  7612.  
  7613. -----------------------------------------------------------------------------
  7614. Subject: 186)  TOPIC: CREATING WIDGETS
  7615.  
  7616. [Looking for submissions: questions asked and answered here, folks!]
  7617.  
  7618. -----------------------------------------------------------------------------
  7619. Subject: 187)* What are some good references for creating widgets (subclassing
  7620. widgets)?
  7621.  
  7622. [Last modified: Feb 95]
  7623.  
  7624. Answer: Ken Sall (ksall@cen.com) writes:
  7625.  
  7626. If you have Motif 2.0, see the new document provided by OSF called "OSF/Motif
  7627. Widget Writer's Guide" in the directory: doc/widgetGuide/Output/draft/ps.
  7628.  
  7629. If you have Motif 1.*, try these references (details in the BOOKS topic):
  7630.  
  7631.     Asente, Paul J., and Swick, Ralph R.,
  7632.     X Window System Toolkit, The Complete Programmer's Guide and Specification.
  7633.  
  7634.     Nye, Adrian & O'Reilly, Tim,
  7635.     X Toolkit Intrinsics Programming Manual.Motif Edition, Volume 4M
  7636.  
  7637.     Flanagan, David, Editor,
  7638.     X Toolkit Intrinsics Reference Manual, Volume 5
  7639.  
  7640.  
  7641. Alex Fridman (alex@genlogic.com) writes:
  7642.  
  7643. For graphical widgets, you may try the Generic Logic Toolkit (GLG Widgets). It
  7644. allows custom graphical widgets (such as Graphs and Controls) to be created
  7645. interactively from the supplied templates using the GLG 3D Graphical Editor. A
  7646. Demo is available by ftp from:
  7647.  
  7648.    ftp://ftp.netcom.com/pub/glg/
  7649.  
  7650. David Suller of Generic Logic, Inc. adds:
  7651.  
  7652. When used in an application, a GLG Widget may be animated with real-time data
  7653. via the resource mechanism or used as a graphical server receiving and
  7654. displaying data from several local or remote processes using the built-in
  7655. Inter-Client Communication Server.
  7656.  
  7657. David Suller                  phone:  (617)254-4153
  7658. Generic Logic, Inc.           FAX:    (617) 254-2746
  7659. P.O. Box 35606                email:  glg@genlogic.com
  7660. Brighton, MA 02135-0006       ftp:    ftp.netcom.com:/pub/glg/
  7661.  
  7662.  
  7663. joe shelby (jshelby@autometric.com) writes:
  7664.  
  7665. Alastair Gourlay (alastair.gourlay@eng.sun.com), a member of the technical
  7666. staff at Sun Microsystems and a former member of the Motif Development group
  7667. at OSF, has written 2 articles for _The X Resource_, published by O'Reilly and
  7668. Associates.
  7669.  
  7670. The first, "Writing Motif Widgets : A Pragmatic Approach" can be found in
  7671. Issue 6.  It covers writing a XmPrimitive-derived widget, deriving from that
  7672. widget, and writing a XmManager-derived widget.  Also included are brief
  7673. summaries of several _Xm private functions for widget writers, how to use the
  7674. Motif 1.2 Representation Type functions, and adding the widgets to Mrm/Uil.
  7675.  
  7676. The second, "The One-Minute Manager : Custom Motif Layout Widgets Made Easy"
  7677. can be found in Issue 10.  It expands and greatly simplifies creating
  7678. composite widgets for Motif.  Gourlay has created and released a new widget,
  7679. the XmpGeometry widget that handles all of the geometry management issues for
  7680. you and provides convenience functions for determiningparent and child
  7681. widgets' perfered sizes.  All the programmer has to do to derive from this
  7682. widget is create the new resources and constraints and implement 2 new class
  7683. methods to override the XmpGeometry's methods.  Included with the XmpGeometry
  7684. class are 3 example derived widgets.
  7685.  
  7686. The code for these widgets is available at
  7687.  
  7688. ftp://ftp.uu.net/published/oreilly/xresource/issue6/Subclassing.tar.Z
  7689. ftp://ftp.uu.net/published/oreilly/xresource/issue10/OneMinuteManagers.tar.Z
  7690.  
  7691. Donald L. McMinds and Joseph P. Whitty have written a book, _Writing Your Own
  7692. OSF/Motif Widgets_, published by Prentice Hall for Hewlett-Packard
  7693. Professional Books.  Both authors work at HP's Workstation Systems Division,
  7694. and have been involved with Motif developement since its beginnings.  The book
  7695. (which is mostly code with explanations) gives details on writing
  7696. XmPrimitive-derived, XmManager-derived, and XmGadget-derived widgets, with one
  7697. example widget for each.  In addition, the book provides "man-pages" for
  7698. several _Xm private functions for programmer convenience.
  7699.  
  7700. The code for these widgets is available at
  7701.  
  7702.         ftp://hpcvaal.cv.hp.com/readonly/book_files/wr_widgets.tar.Z
  7703.  
  7704.  
  7705. -----------------------------------------------------------------------------
  7706. END OF PART FIVE
  7707. Archive-name: motif-faq/part6
  7708. Last-modified: FEB 11, 1995
  7709. Posting-Frequency: monthly
  7710. Organization: Century Computing, Inc.
  7711. Version: 4.1
  7712.  
  7713.  
  7714.  
  7715. -----------------------------------------------------------------------------
  7716. Subject: 188)  TOPIC: MISCELLANEOUS
  7717.  
  7718. -----------------------------------------------------------------------------
  7719. Subject: 189)  How can an application be informed of signals?
  7720.  
  7721. Answer: blackman@hodgkin.med.upenn.edu (David Blackman) writes:
  7722.  
  7723. According to comp.windows.x FAQ, you shouldn't make Xt/Xlib calls from a Unix
  7724. signal handler:
  7725.  
  7726.     "You can work around the problem by setting a flag in the
  7727.     interrupt handler and later checking it with a work procedure
  7728.     or a timer event which has previously been added."
  7729.  
  7730. Kaleb KEITHLEY (fedora.x.org!kaleb) adds:
  7731.  
  7732. Xt is not reentrant and it is not safe to call any Xt functions from a signal
  7733. handler...  I think [the signaling] technique is covered in the [X] FAQ. On
  7734. most POSIX-type systems write(2) is guaranteed to be reentrant and atomic. If
  7735. you establish a simple pipe with the pipe(2) system call, and add it as an
  7736. XtInput with XtAppAddInput(), then you can write to the pipe in the signal
  7737. handler. Xt will notice that input is available and call the input-handler
  7738. proc. This technique is inherently better than setting the flag because the
  7739. write to the pipe will result in XtAppNextEvent returning immediately without
  7740. the latency you observe in using the flag technique.  In R6 you can use the
  7741. XtAppAddSignal function.
  7742.  
  7743. Ken Sall (ksall@cen.com) adds: See the "Signal Handling" chapter of "Motif
  7744. Programming Manual" by Heller and Ferguson, listed in the BOOKS topic.
  7745.  
  7746. Paul Davey (pd@uit.co.uk) adds: The write and XtAppAddInput input method is
  7747. often the best - but be warned it does not work on some SVR3 based Unixes,
  7748. where a pipe may not be selected on. SCO Unix exhibits this behaviour so here
  7749. the external flag method should be used.
  7750.  
  7751. -----------------------------------------------------------------------------
  7752. Subject: 190)  How do I control the repeat rate on a SUN keyboard ??
  7753.  
  7754.  
  7755. Answer:
  7756.  
  7757.      [...]
  7758.  
  7759.      -ar1 milliseconds
  7760.              This option specifies amount of time in milliseconds
  7761.              before   which   a   pressed  key  should  begin  to
  7762.              autorepeat.
  7763.  
  7764.      -ar2 milliseconds
  7765.              This option specifies the interval  in  milliseconds
  7766.              between autorepeats of pressed keys.
  7767.  
  7768. Of course this presumes you're using a server based on the MIT sample server.
  7769.  
  7770. Thanks to kaleb@x.org (Kaleb Keithley)
  7771.  
  7772. -----------------------------------------------------------------------------
  7773. Subject: 191)  How can I identify the children of a manager widget?
  7774.  
  7775. Answer: Use XtGetValues() on XmNchildren (array of widget IDs) and
  7776. XmNnumChildren (number of widgets in array).
  7777.  
  7778. -----------------------------------------------------------------------------
  7779. Subject: 192)  How do I tell if a scrolled window's scrollbars are visible?
  7780.  
  7781. Answer: Use XtGetValues() to get the scrollbar widget ID's, then use
  7782. XtIsManaged() to see if they are managed (visible).
  7783.  
  7784. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  7785.  
  7786. -----------------------------------------------------------------------------
  7787. Subject: 193)  How can I programatically scroll a XmScrolledWindow in
  7788. XmAUTOMATIC mode?
  7789.  
  7790. Answer: In Motif 1.2, use XmScrollVisible().  If you're using a scrolled text
  7791. or scrolled list combination widget, use XmTextScroll() or XmListSet*()
  7792. instead.
  7793.  
  7794. The Motif manuals specifically forbid manipulating the scrollbars directly,
  7795. but some people have reported success with XmScrollBarSetValues, with the
  7796. "notify" parameter set to "True".
  7797.  
  7798. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  7799.  
  7800. -----------------------------------------------------------------------------
  7801. Subject: 194)  What functions can an application use to change the size or
  7802. position of a widget?
  7803.  
  7804. Answer: Applications should set the values of the XmNx, XmNy, XmNwidth, and
  7805. XmNheight resources.
  7806.  
  7807. Note that many manager widgets ignore the XmNx and XmNy resources of their
  7808. children, relying instead on their internal layout algorithms.  If you really
  7809. want specific positions, you must use a manager widget that allows them, e.g.,
  7810. XmBulletinBoard.
  7811.  
  7812. Also note that some manager widgets reject size change requests from their
  7813. children when certain resources are set (e.g., XmNresizable on XmForm).
  7814. Others allow the the children to resize, but clip the results (e.g.,
  7815. XmNallowShellResize on shell widgets).  Make sure you have these resources set
  7816. to the policy you want.
  7817.  
  7818. Due to bugs, some widgets (third party widgets) do not respond to changes in
  7819. their width and height.  Sometimes, you can get them to respond correctly by
  7820. unmanaging them, setting the resources, then managing them again.
  7821.  
  7822. Under no circumstances should applications use routines like
  7823. XtConfigureWidget() or XtResizeWidget().  These routines are reserved for
  7824. widget internals and will seriously confuse many widgets.
  7825.  
  7826. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  7827.  
  7828. -----------------------------------------------------------------------------
  7829. Subject: 195)  What widgets give the look of push buttons, but behavior of
  7830. toggle buttons?
  7831.  
  7832. Answer: Use the XmToggleButton widget, setting XmNindicatorOn to False and
  7833. XmNshadowThickness to 2.
  7834.  
  7835. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  7836.  
  7837. Also set XmNfillOnSelect to True. Otherwise, the background color of the
  7838. button will not stay in the "armed" state.
  7839.  
  7840. thanks to Glenn McMillen, mcmillen@meadow.mdso.vf.ge.com
  7841.  
  7842. In Motif 1.2 (and later), if you specify a XmNselectColor and set
  7843. XmNindicatorOn to False, then you need to set XmNfillOnSelect to True.
  7844. XmNfillOnSelect is not necessary if you are not setting a XmNselectColor.
  7845.  
  7846. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  7847.  
  7848.  
  7849. -----------------------------------------------------------------------------
  7850. Subject: 196)  How do I obtain the size of a unmanaged shell widget?
  7851.  
  7852. Answer: In the code below, use getsize() for widgets which have been managed,
  7853. and getsize2() for newly created shell widgets which have not yet been
  7854. managed.
  7855.  
  7856. getsize2() takes two widget parameters because popup dialogs etc.  _consist_
  7857. of two separate widgets - the parent shell and the child bulletin board, form,
  7858. whatever.  This important distinction (somewhat glossed over in the Motif
  7859. manuals) is the cause of a large number of queries in comp.windows.x.motif.
  7860. XmCreate...Dialog() functions return the (bulletin board, form, whatever)
  7861. _child_ of the pair, not the parent shell.
  7862.  
  7863. getsize2() takes the _shell_ widget as it's first parameter, and the shell's
  7864. _child_ (the bulletin board, form, whatever) as it's second.  Thus, if you are
  7865. using code like widget = XmCreate...Dialog() to create your popup dialogs, use
  7866. code like getsize2(XtParent(widget),widget,&width,&height) to get the width
  7867. and height. If you use e.g. XmCreateDialogShell() or XtCreatePopupShell(),
  7868. then you are creating the the shell widget and it's child explicitly, and can
  7869. just pass them into getsize2() with no problem.
  7870.  
  7871. Note: getsize2() calls getsize().
  7872.  
  7873. /* getsize(widget,width,height);
  7874.  * Widget widget;
  7875.  * int *width,*height;
  7876.  *
  7877.  * returns the width and height of a managed widget */
  7878.  
  7879.  
  7880. void getsize(l,w,h) Widget l; int *w,*h; { Dimension w_,h_,b_;
  7881.  
  7882. static Arg size_args[] =
  7883.   {
  7884.   { XmNwidth,0 },
  7885.   { XmNheight,0 },
  7886.   { XmNborderWidth,0 },
  7887.   };
  7888.  
  7889. size_args[0].value = (XtArgVal)&w_; size_args[1].value = (XtArgVal)&h_;
  7890. size_args[2].value = (XtArgVal)&b_;
  7891.  
  7892. XtGetValues(l,size_args,3);
  7893.  
  7894. if (w) *w = w_ + b_; if (h) *h = h_ + b_; } /*
  7895. getsize2(shell,child,width,height);
  7896.  * Widget shell,child;
  7897.  * int *width,*height;
  7898.  *
  7899.  * returns the width, height of an unmanaged shell widget */
  7900.  
  7901. void getsize2(p,c,w,h) Widget p,c; int *w,*h; { XtSetMappedWhenManaged(p,0);
  7902.  
  7903. XtManageChild(c);
  7904.  
  7905. getsize(p,w,h);
  7906.  
  7907. XtUnmanageChild(c);
  7908.  
  7909. XtSetMappedWhenManaged(p,-1); } submitted by: [ Huw Rogers  Communications
  7910. Software Engineer, NEC Corporation, Tokyo, Japan ] [ Email:
  7911. rogersh@ccs.mt.nec.co.jp  Fax: +81-3-5476-1005  Tel: +81-3-5476-1096 ]
  7912.  
  7913. -----------------------------------------------------------------------------
  7914. Subject: 197)  Can I use XtAddTimeOut, XtAddWorkProc, and XtAddInput with
  7915. XtAppMainLoop?
  7916.  
  7917. Answer: On many systems, the obsolete XtAdd*() functions are not compatible
  7918. with the XtAppMainLoop().  Instead, you should use newer XtAppAddTimeOut(),
  7919. XtAppAddWorkProc(), and XtAppAddInput() functions with XtAppMainLoop()
  7920.  
  7921. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  7922.  
  7923. -----------------------------------------------------------------------------
  7924. Subject: 198)  Why does XtGetValues for XmNx and XmNwidth return extremely
  7925. large values?
  7926.  
  7927. Answer: You must use the 16 bit "Dimension" and "Position" data types for your
  7928. arguments.  If you use 32 bit integers, some implementations will fill the
  7929. remaining 16 bits with invalid data, causing incorrect return values.  The
  7930. *Motif Programmer's Manual* and the widget man pages specify the correct data
  7931. type for each resource.
  7932.  
  7933. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  7934.  
  7935. -----------------------------------------------------------------------------
  7936. Subject: 199)  XtGetValues() on XmNx and XmNy of my top level shell don't
  7937. return the correct root window coordinates.  How do I compute these?
  7938.  
  7939. Answer: XmNx and XmNy are the coordinates relative to your shell's parent
  7940. window, which is usually a window manager's frame window.  To translate to the
  7941. root coordinate space, use XtTranslateCoords() or XTranslateCoordinates().
  7942.  
  7943. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  7944.  
  7945. -----------------------------------------------------------------------------
  7946. Subject: 200)  Can I use XmGetPixmap() with widgets that have non-default
  7947. visual types?
  7948.  
  7949. Answer: XmGetPixmap() assumes that you are using the default screen depth.  If
  7950. you're using a different depth, use XmGetPixmapByDepth() instead.
  7951.  
  7952. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  7953.  
  7954. -----------------------------------------------------------------------------
  7955. Subject: 201)  How can I determine the item selected in a option menu or a
  7956. RadioBox?
  7957.  
  7958. Answer: The value of the XmNmenuHistory resource of the XmRowColumn parent is
  7959. the widget ID of the last selected item.  It works the same way for all menus
  7960. and radio boxes.
  7961.  
  7962. Thanks to Ken Lee, kenton@allegro.esd.sgi.com
  7963.  
  7964. -----------------------------------------------------------------------------
  7965. Subject: 202)  What is the matter with Frame in Motif 1.2?
  7966.  
  7967. [Last modified: November 92]
  7968.  
  7969. Answer: This announcement has been made by OSF:
  7970.  
  7971. "IMPORTANT NOTICE
  7972.  
  7973. We have discovered two problems in the new 1.2 child alignment resources in
  7974. XmFrame. Because some vendors may have committed, or are soon to commit to
  7975. field releases of Motif 1.2 and 1.2.1, OSF's options for fixing them are
  7976. limited. We are trying to deal with these in a way that does not cause
  7977. hardship for application developers who will develop applications against
  7978. various point versions of Motif. OSF's future actions for correction are
  7979. summarized.
  7980.  
  7981. WHAT YOU SHOULD DO AND KNOW
  7982.  
  7983. 1. Mark the following change in your documentation.
  7984.  
  7985. On page 1-512 of the OSF/Motif Programmer's Reference, change the descriptions
  7986. under XmNchildVerticalAlignment as follows (what follows is the CORRECT
  7987. wording to match the current implementation):
  7988.  
  7989. XmALIGNMENT_WIDGET_TOP
  7990.         Causes the BOTTOM edge of the title area to align
  7991.         vertically with the top shadow of the Frame.
  7992.  
  7993. XmALIGNMENT_WIDGET_BOTTOM
  7994.         Causes the TOP edge of the title area to align
  7995.         vertically with the top shadow of the Frame.
  7996.  
  7997. 2. Note the following limitation on resource converters for Motif 1.2 and
  7998. 1.2.1 implementations.
  7999.  
  8000. The rep types for XmFrame's XmNentryVerticalAlignment resource were
  8001. incorrected implemented, which means that converters will not work properly.
  8002. The following resource settings will not work from a resource file in 1.2 and
  8003. 1.2.1:
  8004.  
  8005.         *childVerticalAlignment: alignment_baseline_bottom
  8006.         *childVerticalAlignment: alignment_baseline_top
  8007.         *childVerticalAlignment: alignment_widget_bottom
  8008.         *childVerticalAlignment: alignment_widget_top
  8009.  
  8010. If you wish to set these values for these resources (note they are new
  8011. constraint resources in XmFrame) you will have to set them directly in C or
  8012. via uil.
  8013.  
  8014. WHAT WE WILL DO
  8015.  
  8016. The problem described in note #1 above will not be fixed in the OSF/Motif
  8017. implementation until the next MAJOR release of Motif.  At that time we will
  8018. correct the documentation and modify the code to match those new descriptions,
  8019. but we will preserve the existing enumerated values and their behavior for
  8020. backward compatibility for that release.
  8021.  
  8022. The fix for the problem described in note #2 will be shipped by OSF in Motif
  8023. 1.2.2.
  8024.  
  8025. SUMMARY
  8026.  
  8027. We are sorry for any difficulty this causes Motif users.  If you have any
  8028. questions or flames (I suppose I deserve it) please send them directly to me.
  8029. We sincerely hope this proactive response is better for our customers than you
  8030. having to figure it out yourselves!
  8031.  
  8032. Libby
  8033.  
  8034.  
  8035. -----------------------------------------------------------------------------
  8036. Subject: 203)  What is IMUG and how do I join it?
  8037.  
  8038. Answer: IMUG is the International Motif User Group founded by Quest Windows
  8039. Corporation and co-sponsored by FedUNIX.  IMUG is a non-profit organization
  8040. working to keep users informed on technical and standards issues, to
  8041. strengthen user groups on a local level, to increase communication among users
  8042. internationally, and to promote the use of an international conference as a
  8043. forum for sharing and learning more about Motif.  You can join it by
  8044.  
  8045.  1.  Pay the annual membership fee of $20 USD directly to IMUG.  Contact
  8046.  
  8047.      IMUG
  8048.      5200 Great America Parkway
  8049.      Santa Clara,  CA  95054
  8050.      (408) 496-1900
  8051.      imug@quest.com
  8052.  
  8053.  2.  Register at the International Motif User Conference, and automatically
  8054.      become an IMUG member.
  8055.  
  8056.  3.  Donate a pd widget, widget tool or widget builder to the IMUG Widget
  8057.      Depository and receive a free one year IMUG membership.
  8058.  
  8059.  
  8060. -----------------------------------------------------------------------------
  8061. Subject: 204)  How do I set the title of a top level window?
  8062.  
  8063. [Last modified: September 92]
  8064.  
  8065. Answer: Set XmNtitle (and optionally XmNtitleEncoding) for TopLevelShells.
  8066. (Note that this is of type String rather than XmStrin.) Ypu can also set
  8067. XmNiconName if you want its icon to show this title.  For XmDialogShells, set
  8068. the XmNdialogTitle of its immediate child, assuming it's a BulletinBoard
  8069. subclass.  These can also be set in resource files.
  8070.  
  8071.  
  8072. -----------------------------------------------------------------------------
  8073. Subject: 205)  Can I use editres with Motif?
  8074.  
  8075. [Last modified: Sept 94]
  8076.  
  8077. Answer: Editres, part of the MIT delivery, is a powerful widget tree analysis
  8078. tool and is highly recommended.  There's negligible overhead in making editres
  8079. available to an application and many projects keep the editres "hook" active
  8080. even for operational programs.
  8081.  
  8082. It isn't built in to Motif (at 1.2.0), but you can do this in your application
  8083.  
  8084.     extern void _XEditResCheckMessages();
  8085.     ...
  8086.     XtAddEventHandler(shell_widget, (EventMask)0, True,
  8087.                         _XEditResCheckMessages, NULL);
  8088.  
  8089. once for each shell widget that you want to react to the "click to select
  8090. client" protocol.  Then link your client with the R5 libXmu.
  8091.  
  8092. David Brooks, OSF
  8093.  
  8094. From Marc Quinton (quinton@stna7.stna7.stna.dgac.fr):
  8095.  
  8096. With X11R4 see the Editres package which is a port of the X11R5 Editres
  8097. protocol and client. You can find it at :
  8098.  
  8099.  ftp.stna7.stna.dgac.fr(143.196.9.83):/pub/dist/Editres.tar.Z
  8100.  
  8101. -----------------------------------------------------------------------------
  8102. Subject: 206)  How can I put decorations on transient windows using olwm?
  8103.  
  8104. Answer: From Jean-Philippe Martin-Flatin <syj@ecmwf.co.uk>
  8105.  
  8106.  
  8107. /**********************************************************************
  8108. ** WindowDecorations.c
  8109. **
  8110. ** Manages window decorations under the OpenLook window manager (OLWM).
  8111. **
  8112. ** Adapted from a C++ program posted to comp.windows.x.motif by:
  8113. **
  8114. **    +--------------------------------------------------------------+
  8115. **    | Ron Edmark                          User Interface Group     |
  8116. **    | Tel:        (408) 980-1500 x282     Integrated Systems, Inc. |
  8117. **    | Internet:   edmark@isi.com          3260 Jay St.             |
  8118. **    | Voice mail: (408) 980-1590 x282     Santa Clara, CA 95054    |
  8119. **    +--------------------------------------------------------------+
  8120. ***********************************************************************/
  8121.  
  8122. #include <X11/X.h>
  8123. #include <X11/Xlib.h>
  8124. #include <X11/Xatom.h>
  8125. #include <X11/Intrinsic.h>
  8126. #include <X11/StringDefs.h>
  8127. #include <X11/Protocols.h>
  8128. #include <Xm/Xm.h>
  8129. #include <Xm/AtomMgr.h>
  8130.  
  8131. /*
  8132. ** Decorations for OpenLook:
  8133. ** The caller can OR different mask options to change the frame decoration.
  8134. */
  8135. #define OLWM_Header     (long)(1<<0)
  8136. #define OLWM_Resize     (long)(1<<1)
  8137. #define OLWM_Close      (long)(1<<2)
  8138.  
  8139. /*
  8140. ** Prototypes
  8141. */
  8142. static void InstallOLWMAtoms  (Widget w);
  8143. static void AddOLWMDialogFrame(Widget widget, long decorationMask);
  8144.  
  8145.  
  8146. /*
  8147. ** Global variables
  8148. */
  8149. static Atom AtomWinAttr;
  8150. static Atom AtomWTOther;
  8151. static Atom AtomDecor;
  8152. static Atom AtomResize;
  8153. static Atom AtomHeader;
  8154. static Atom AtomClose;
  8155. static int  not_installed_yet = TRUE;
  8156.  
  8157.  
  8158. static void InstallOLWMAtoms(Widget w)
  8159. {
  8160.         AtomWinAttr = XInternAtom(XtDisplay(w), "_OL_WIN_ATTR" ,    FALSE);
  8161.         AtomWTOther = XInternAtom(XtDisplay(w), "_OL_WT_OTHER",     FALSE);
  8162.         AtomDecor   = XInternAtom(XtDisplay(w), "_OL_DECOR_ADD",    FALSE);
  8163.         AtomResize  = XInternAtom(XtDisplay(w), "_OL_DECOR_RESIZE", FALSE);
  8164.         AtomHeader  = XInternAtom(XtDisplay(w), "_OL_DECOR_HEADER", FALSE);
  8165.         AtomClose   = XInternAtom(XtDisplay(w), "_OL_DECOR_CLOSE",  FALSE);
  8166.  
  8167.         not_installed_yet = FALSE;
  8168. }
  8169.  
  8170. static void AddOLWMDialogFrame(Widget widget, long decorationMask)
  8171. {
  8172.         Atom   winAttrs[2];
  8173.         Atom   winDecor[3];
  8174.         Widget shell = widget;
  8175.         Window win;
  8176.         int    numberOfDecorations = 0;
  8177.  
  8178.         /*
  8179.         ** Make sure atoms for OpenLook are installed only once
  8180.         */
  8181.         if (not_installed_yet) InstallOLWMAtoms(widget);
  8182.  
  8183.         while (!XtIsShell(shell)) shell = XtParent(shell);
  8184.  
  8185.         win = XtWindow(shell);
  8186.  
  8187.         /*
  8188.         ** Tell Open Look that our window is not one of the standard OLWM window        ** types. See OLIT Widget Set Programmer's Guide pp.70-73.
  8189.         */
  8190.  
  8191.         winAttrs[0] = AtomWTOther;
  8192.  
  8193.         XChangeProperty(XtDisplay(shell),
  8194.                         win,
  8195.                         AtomWinAttr,
  8196.                         XA_ATOM,
  8197.                         32,
  8198.                         PropModeReplace,
  8199.                         (unsigned char*)winAttrs,
  8200.                         1);
  8201.  
  8202.         /*
  8203.         ** Tell Open Look to add some decorations to our window
  8204.         */
  8205.         numberOfDecorations = 0;
  8206.         if (decorationMask & OLWM_Header)
  8207.                 winDecor[numberOfDecorations++] = AtomHeader;
  8208.         if (decorationMask & OLWM_Resize)
  8209.                 winDecor[numberOfDecorations++] = AtomResize;
  8210.         if (decorationMask & OLWM_Close)
  8211.         {
  8212.                 winDecor[numberOfDecorations++] = AtomClose;
  8213.  
  8214.                 /*
  8215.                 ** If the close button is specified, the header must be
  8216.                 ** specified. If the header bit is not set, set it.
  8217.                 */
  8218.                 if (!(decorationMask & OLWM_Header))
  8219.                         winDecor[numberOfDecorations++] = AtomHeader;
  8220.         }
  8221.  
  8222.         XChangeProperty(XtDisplay(shell),
  8223.                         win,
  8224.                         AtomDecor,
  8225.                         XA_ATOM,
  8226.                         32,
  8227.                         PropModeReplace,
  8228.                         (unsigned char*)winDecor,
  8229.                         numberOfDecorations);
  8230. }
  8231.  
  8232.  
  8233. /*
  8234. ** Example of use of AddOLWMDialogFrame, with a bit of extra stuff
  8235. */
  8236. void register_dialog_to_WM(Widget shell, XtCallbackProc Cbk_func)
  8237. {
  8238.         Atom atom;
  8239.  
  8240.         /*
  8241.         ** Alias the "Close" item in system menu attached to dialog shell
  8242.         ** to the activate callback of "Exit" in the menubar
  8243.         */
  8244.         if (Cbk_func)
  8245.         {
  8246.             atom = XmInternAtom(XtDisplay(shell),"WM_DELETE_WINDOW",TRUE);
  8247.             XmAddWMProtocolCallback(shell,atom, Cbk_func,NULL);
  8248.         }
  8249.  
  8250.         /*
  8251.         ** If Motif is the window manager, skip OpenLook specific stuff
  8252.         */
  8253.         if (XmIsMotifWMRunning(shell)) return;
  8254.  
  8255.         /*
  8256.         ** Register dialog shell to OpenLook.
  8257.         **
  8258.         ** WARNING: on some systems, adding the "Close" button allows the title
  8259.         ** to be properly centered in the title bar. On others, activating
  8260.         ** "Close" crashes OpenLook. The reason is not clear yet, but it seems
  8261.         ** the first case occurs with OpenWindows 2 while the second occurs with
  8262.         ** Openwindows 3. Thus, comment out one of the two following lines as
  8263.         ** suitable for your site, and send e-mail to syj@ecmwf.co.uk if you
  8264.         ** find out what is going on !
  8265.         */
  8266.         AddOLWMDialogFrame(shell,(OLWM_Header | OLWM_Resize));
  8267. /*      AddOLWMDialogFrame(shell,(OLWM_Header | OLWM_Resize | OLWM_Close)); */
  8268. }
  8269.  
  8270.  
  8271. -----------------------------------------------------------------------------
  8272. Subject: 207)  Why does an augment translation appear to act as replace for
  8273. some widgets?  When I use either augment or override translations in
  8274. .Xdefaults it seems to act as replace in both Motif 1.0 and 1.1
  8275.  
  8276. Answer: By default, the translation table is NULL.  If there is nothing
  8277. specified (either in resource file, or in args), the widget's Initialize
  8278. finds: Oh, there is NULL in translations, lets use our default ones.  If,
  8279. however, the translations have become non-NULL, the default translations are
  8280. NOT used at all. Thus, using #augment, #override or a new table has identical
  8281. effect: defines the new translations. The only way you can augment/override
  8282. Motif's default translations is AFTER Initialize, using XtSetValues.  Note,
  8283. however, that Motif managers do play with translation tables as well ... so
  8284. that results are not always easy to predict.
  8285.  
  8286. From OSF: A number of people have complained about not being able to
  8287. augment/override translations from the .Xdefaults.  This is due to the
  8288. complexity of the menu system/keyboard traversal and the necessary
  8289. translations changes required to support the Motif Style Guide in menus.  It
  8290. cannot be fixed in a simple way. Fixing it requires re-design of the
  8291. menus/buttons and it is planned to be fixed in 1.2.
  8292.  
  8293. -----------------------------------------------------------------------------
  8294. Subject: 208)  How do you "grey" out a widget so that it cannot be activated?
  8295.  
  8296. Answer: Use XtSetSensitive(widget, False). Do not set the XmNsensitive
  8297. resource directly yourself (by XtSetValues) since the widget may need to talk
  8298. to parents first.
  8299.  
  8300. -----------------------------------------------------------------------------
  8301. Subject: 209)  Why doesn't the Help callback work on some widgets?
  8302.  
  8303. [Last modified: Oct 94]
  8304.  
  8305. Answer: If you press the help key the help callback of the widget with the
  8306. keyboard focus is called (not the one containing the mouse).  You can't get
  8307. the help callback of a non-keyboard-selectable widget called. To get `context
  8308. sensitive' help on these, you have to find the mouse, associate its position
  8309. with a widget and then do the help.
  8310.  
  8311.  The X Resource, Issue 6, has an article on implementing context help in
  8312.  Motif in this manner, that is, using the mouse position to indicate the
  8313.  widget for which context help is desired, as well as using resources to
  8314.  specify the help.  Example source code is available at
  8315.  
  8316.         ftp://ora.com/pub/examples/xresource/issue6/helpdemo.tar.Z
  8317.  
  8318.  The demo program lets you toggle between using the method described in
  8319.  the article and XmTrackingLocate() for comparision purposes.
  8320.  
  8321. contributed by: Jay Schmidgall  jay@vnet.ibm.com (author of the article
  8322. mentioned above) --
  8323.  
  8324. -----------------------------------------------------------------------------
  8325. Subject: 210)  Can I specify a widget in a resource file?
  8326.  
  8327. Answer: This answer, which uses the Xmu library, is due to David Elliott.  If
  8328. the converter is added, then the name of a widget (a string) can be used in
  8329. resource files, and will be converted to the appropriate widget.
  8330.  
  8331. This code, which was basically stolen from the Athena Form widget, adds a
  8332. String to Widget converter.  I wrote it as a general routine that I call at
  8333. the beginning of all of my programs, and made it so I could add other
  8334. converters as needed (like String to Unit Type ;-).
  8335.  
  8336.         #include <X11/Intrinsic.h>
  8337.         #include <X11/StringDefs.h>
  8338.         #include <Xm/Xm.h>
  8339.         #include <X11/Xmu/Converters.h>
  8340.         #include <X11/IntrinsicP.h>
  8341.         #include <X11/CoreP.h>
  8342.  
  8343.         void
  8344.         setupConverters()
  8345.         {
  8346.                 static XtConvertArgRec parentCvtArgs[] = {
  8347.                         {XtBaseOffset, (caddr_t)XtOffset(Widget, core.parent),
  8348.                                 sizeof(Widget)}
  8349.                 };
  8350.  
  8351.                 XtAddConverter(XmRString, XmRWindow, XmuCvtStringToWidget,
  8352.                         parentCvtArgs, XtNumber(parentCvtArgs));
  8353.         }
  8354.  
  8355.  
  8356. -----------------------------------------------------------------------------
  8357. Subject: 211)  Why are only some of my translations are being installed?  I
  8358. have a translation table like the following, but only the first ones are
  8359. getting installed and the rest are ignored.
  8360.  
  8361.  *Text.translations:    #override \
  8362.      Ctrl<Key>a:    beginning-of-line() \n\
  8363.      Ctrl<Key>e:    end-of-line() \n\
  8364.      Ctrl<Key>f:    forward-character() \n\
  8365.  
  8366.  
  8367. Answer: Most likely, you have a space at the end of one of the lines (the
  8368. first in this case).
  8369.  
  8370.      Ctrl<Key>a:    beginning-of-line() \n\
  8371.                                            ^ space here
  8372.  
  8373. The second backslash in each line is there to protect the real newline
  8374. character and so you must not follow it with anything other than the newline
  8375. itself. Otherwise it acts as the end of the resource definition and the
  8376. remaining lines are not added.
  8377.  
  8378.  
  8379. -----------------------------------------------------------------------------
  8380. Subject: 212)  Where can I get the PanHandler code?
  8381.  
  8382. Answer: It is available by email from Chuck Ocheret:  chuck@IMSI.COM.
  8383.  
  8384. -----------------------------------------------------------------------------
  8385. Subject: 213)  What are these passive grab warnings?  When I destroy certain
  8386. widgets I get a stream of messages
  8387.  
  8388.     Warning: Attempt to remove non-existant passive grab
  8389.  
  8390.  
  8391. Answer: They are meaningless, and you want to ignore them.  Do this (from Kee
  8392. Hinckley) by installing an XtWarning handler that explicitly looks for them
  8393. and discards them:
  8394.  
  8395.         static void xtWarnCB(String message) {
  8396.            if (asi_strstr(message, "non-existant passive grab", TRUE)) return;
  8397.            ...
  8398.  
  8399. They come from Xt, and (W. Scott Meeks): "it's something that the designers of
  8400. Xt decided the toolkit should do. Unfortunately, Motif winds up putting
  8401. passive grabs all over the place for the menu system.  On the one hand, we
  8402. want to remove all these grabs when menus get destroyed so that they don't
  8403. leak memory; on the other hand, it's almost impossible to keep track of all
  8404. the grabs, so we have a conservative strategy of ungrabbing any place where a
  8405. grab could have been made and we don't explicitly know that there is no grab.
  8406. The unfortunate side effect is the little passive grab warning messages.
  8407. We're trying to clean these up where possible, but there are some new places
  8408. where the warning is generated.  Until we get this completely cleaned up (1.2
  8409. maybe), your best bet is probably to use a warning handler."
  8410.  
  8411. -----------------------------------------------------------------------------
  8412. Subject: 214)* How do I have more buttons than three in a MessageBox?  I want
  8413. to have something like a MessageBox (or other widget) with more than three
  8414. buttons, but with the same nice appearance.
  8415.  
  8416. [Last modified: Feb 95]
  8417.  
  8418. Answer: The Motif 1.2 MessageBox widget allows extra buttons to be added after
  8419. the OK button. Just create the extra buttons as children of the MessageBox.
  8420. Similarly with the SelectionBox.
  8421.  
  8422. Pre-Motif 1.2, you have to do one of the following methods.
  8423.  
  8424. A SelectionBox is created with four buttons, but the fourth (the Apply button)
  8425. is unmanaged. To manage it get its widget ID via
  8426. XmSelectionBoxGetChild(parent, XmDIALOG_APPLY_BUTTON) and then XtManage it.
  8427. Unmanage all of the other bits in the SelectionBox that you don't want.  If
  8428. you want more than four buttons, try two SelectionBoxes (or similar) together
  8429. in a container, where all of the unwanted parts of the widgets are unmanaged.
  8430.  
  8431. Alternatively, build your own dialog:
  8432.  
  8433. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  8434.  * This program is freely distributable without licensing fees and
  8435.  * is provided without guarantee or warranty expressed or implied.
  8436.  * This program is -not- in the public domain.  This program is
  8437.  * taken from the Motif Programming Manual, O'Reilly Volume 6.
  8438.  */
  8439.  
  8440. /* action_area.c -- demonstrate how CreateActionArea() can be used
  8441.  * in a real application.  Create what would otherwise be identified
  8442.  * as a PromptDialog, only this is of our own creation.  As such,
  8443.  * we provide a TextField widget for input.  When the user presses
  8444.  * Return, the Ok button is activated.
  8445.  */
  8446. #include <Xm/DialogS.h>
  8447. #include <Xm/PushBG.h>
  8448. #include <Xm/PushB.h>
  8449. #include <Xm/LabelG.h>
  8450. #include <Xm/PanedW.h>
  8451. #include <Xm/Form.h>
  8452. #include <Xm/RowColumn.h>
  8453. #include <Xm/TextF.h>
  8454.  
  8455. typedef struct {
  8456.     char *label;
  8457.     void (*callback)();
  8458.     caddr_t data;
  8459. } ActionAreaItem;
  8460.  
  8461. static void
  8462.     do_dialog(), close_dialog(), activate_cb(),
  8463.     ok_pushed(), cancel_pushed(), help();
  8464.  
  8465. main(argc, argv)
  8466. int argc;
  8467. char *argv[];
  8468. {
  8469.     Widget toplevel, button;
  8470.     XtAppContext app;
  8471.  
  8472.     toplevel = XtVaAppInitialize(&app, "Demos",
  8473.         NULL, 0, &argc, argv, NULL, NULL);
  8474.  
  8475.     button = XtVaCreateManagedWidget("Push Me",
  8476.         xmPushButtonWidgetClass, toplevel, NULL);
  8477.     XtAddCallback(button, XmNactivateCallback, do_dialog, NULL);
  8478.  
  8479.     XtRealizeWidget(toplevel);
  8480.     XtAppMainLoop(app);
  8481. }
  8482.  
  8483. /* callback routine for "Push Me" button.  Actually, this represents
  8484.  * a function that could be invoked by any arbitrary callback.  Here,
  8485.  * we demonstrate how one can build a standard customized dialog box.
  8486.  * The control area is created here and the action area is created in
  8487.  * a separate, generic routine: CreateActionArea().
  8488.  */
  8489. static void
  8490. do_dialog(w, file)
  8491. Widget w; /* will act as dialog's parent */
  8492. char *file;
  8493. {
  8494.     Widget dialog, pane, rc, label, text_w, action_a;
  8495.     XmString string;
  8496.     extern Widget CreateActionArea();
  8497.     Arg args[10];
  8498.     static ActionAreaItem action_items[] = {
  8499.         { "Ok",     ok_pushed,     NULL          },
  8500.         { "Cancel", cancel_pushed, NULL          },
  8501.         { "Close",  close_dialog,  NULL          },
  8502.         { "Help",   help,          "Help Button" },
  8503.     };
  8504.  
  8505.     /* The DialogShell is the Shell for this dialog.  Set it up so
  8506.      * that the "Close" button in the window manager's system menu
  8507.      * destroys the shell (it only unmaps it by default).
  8508.      */
  8509.     dialog = XtVaCreatePopupShell("dialog",
  8510.         xmDialogShellWidgetClass, XtParent(w),
  8511.         XmNtitle,  "Dialog Shell",     /* give arbitrary title in wm */
  8512.         XmNdeleteResponse, XmDESTROY,  /* system menu "Close" action */
  8513.         NULL);
  8514.  
  8515.     /* now that the dialog is created, set the Close button's
  8516.      * client data, so close_dialog() will know what to destroy.
  8517.      */
  8518.     action_items[2].data = (caddr_t)dialog;
  8519.  
  8520.     /* Create the paned window as a child of the dialog.  This will
  8521.      * contain the control area (a Form widget) and the action area
  8522.      * (created by CreateActionArea() using the action_items above).
  8523.      */
  8524.     pane = XtVaCreateWidget("pane", xmPanedWindowWidgetClass, dialog,
  8525.         XmNsashWidth,  1,
  8526.         XmNsashHeight, 1,
  8527.         NULL);
  8528.  
  8529.     /* create the control area (Form) which contains a
  8530.      * Label gadget and a List widget.
  8531.      */
  8532.     rc = XtVaCreateWidget("control_area", xmRowColumnWidgetClass, pane, NULL);
  8533.     string = XmStringCreateLocalized("Type Something:");
  8534.     XtVaCreateManagedWidget("label", xmLabelGadgetClass, rc,
  8535.         XmNlabelString,    string,
  8536.         XmNleftAttachment, XmATTACH_FORM,
  8537.         XmNtopAttachment,  XmATTACH_FORM,
  8538.         NULL);
  8539.     XmStringFree(string);
  8540.  
  8541.     text_w = XtVaCreateManagedWidget("text-field",
  8542.         xmTextFieldWidgetClass, rc, NULL);
  8543.  
  8544.     /* RowColumn is full -- now manage */
  8545.     XtManageChild(rc);
  8546.  
  8547.     /* Set the client data "Ok" and "Cancel" button's callbacks. */
  8548.     action_items[0].data = (caddr_t)text_w;
  8549.     action_items[1].data = (caddr_t)text_w;
  8550.  
  8551.     /* Create the action area -- we don't need the widget it returns. */
  8552.     action_a = CreateActionArea(pane, action_items, XtNumber(action_items));
  8553.  
  8554.     /* callback for Return in TextField.  Use action_a as client data */
  8555.     XtAddCallback(text_w, XmNactivateCallback, activate_cb, action_a);
  8556.  
  8557.     XtManageChild(pane);
  8558.     XtPopup(dialog, XtGrabNone);
  8559. }
  8560.  
  8561. /*--------------*/
  8562. /* The next four functions are the callback routines for the buttons
  8563.  * in the action area for the dialog created above.  Again, they are
  8564.  * simple examples, yet they demonstrate the fundamental design approach.
  8565.  */
  8566. static void
  8567. close_dialog(w, shell)
  8568. Widget w, shell;
  8569. {
  8570.     XtDestroyWidget(shell);
  8571. }
  8572.  
  8573. /* The "ok" button was pushed or the user pressed Return */
  8574. static void
  8575. ok_pushed(w, text_w, cbs)
  8576. Widget w, text_w;         /* the text widget is the client data */
  8577. XmAnyCallbackStruct *cbs;
  8578. {
  8579.     char *text = XmTextFieldGetString(text_w);
  8580.  
  8581.     printf("String = %s0, text);
  8582.     XtFree(text);
  8583. }
  8584.  
  8585. static void
  8586. cancel_pushed(w, text_w, cbs)
  8587. Widget w, text_w;         /* the text field is the client data */
  8588. XmAnyCallbackStruct *cbs;
  8589. {
  8590.     /* cancel the whole operation; reset to NULL. */
  8591.     XmTextFieldSetString(text_w, "");
  8592. }
  8593.  
  8594. static void
  8595. help(w, string)
  8596. Widget w;
  8597. String string;
  8598. {
  8599.     puts(string);
  8600. }
  8601. /*--------------*/
  8602.  
  8603. /* When Return is pressed in TextField widget, respond by getting
  8604.  * the designated "default button" in the action area and activate
  8605.  * it as if the user had selected it.
  8606.  */
  8607. static void
  8608. activate_cb(text_w, client_data, cbs)
  8609. Widget text_w;              /* user pressed Return in this widget */
  8610. XtPointer client_data;        /* action_area passed as client data */
  8611. XmAnyCallbackStruct *cbs;   /* borrow the "event" field from this */
  8612. {
  8613.     Widget dflt, action_area = (Widget)client_data;
  8614.  
  8615.     XtVaGetValues(action_area, XmNdefaultButton, &dflt, NULL);
  8616.     if (dflt) /* sanity check -- this better work */
  8617.         /* make the default button think it got pushed.  This causes
  8618.          * "ok_pushed" to be called, but XtCallActionProc() causes
  8619.          * the button appear to be activated as if the user selected it.
  8620.          */
  8621.         XtCallActionProc(dflt, "ArmAndActivate", cbs->event, NULL, 0);
  8622. }
  8623.  
  8624. #define TIGHTNESS 20
  8625.  
  8626. Widget
  8627. CreateActionArea(parent, actions, num_actions)
  8628. Widget parent;
  8629. ActionAreaItem *actions;
  8630. int num_actions;
  8631. {
  8632.     Widget action_area, widget;
  8633.     int i;
  8634.  
  8635.     action_area = XtVaCreateWidget("action_area", xmFormWidgetClass, parent,
  8636.         XmNfractionBase, TIGHTNESS*num_actions - 1,
  8637.         XmNleftOffset,   10,
  8638.         XmNrightOffset,  10,
  8639.         NULL);
  8640.  
  8641.     for (i = 0; i < num_actions; i++) {
  8642.         widget = XtVaCreateManagedWidget(actions[i].label,
  8643.             xmPushButtonWidgetClass, action_area,
  8644.             XmNleftAttachment,       i? XmATTACH_POSITION : XmATTACH_FORM,
  8645.             XmNleftPosition,         TIGHTNESS*i,
  8646.             XmNtopAttachment,        XmATTACH_FORM,
  8647.             XmNbottomAttachment,     XmATTACH_FORM,
  8648.             XmNrightAttachment,
  8649.                     i != num_actions-1? XmATTACH_POSITION : XmATTACH_FORM,
  8650.             XmNrightPosition,        TIGHTNESS*i + (TIGHTNESS-1),
  8651.             XmNshowAsDefault,        i == 0,
  8652.             XmNdefaultButtonShadowThickness, 1,
  8653.             NULL);
  8654.         if (actions[i].callback)
  8655.             XtAddCallback(widget, XmNactivateCallback,
  8656.                 actions[i].callback, actions[i].data);
  8657.         if (i == 0) {
  8658.             /* Set the action_area's default button to the first widget
  8659.              * created (or, make the index a parameter to the function
  8660.              * or have it be part of the data structure). Also, set the
  8661.              * pane window constraint for max and min heights so this
  8662.              * particular pane in the PanedWindow is not resizable.
  8663.              */
  8664.             Dimension height, h;
  8665.             XtVaGetValues(action_area, XmNmarginHeight, &h, NULL);
  8666.             XtVaGetValues(widget, XmNheight, &height, NULL);
  8667.             height += 2 * h;
  8668.             XtVaSetValues(action_area,
  8669.                 XmNdefaultButton, widget,
  8670.                 XmNpaneMaximum,   height,
  8671.                 XmNpaneMinimum,   height,
  8672.                 NULL);
  8673.         }
  8674.     }
  8675.  
  8676.     XtManageChild(action_area);
  8677.  
  8678.     return action_area;
  8679. }
  8680.  
  8681.  
  8682. -----------------------------------------------------------------------------
  8683. Subject: 215)* How do I create a "busy working cursor"?
  8684.  
  8685. [Last modified: Feb 95]
  8686.  
  8687. Answer: - in Baudouin's code (following), the idea is to keep in an array an
  8688. up-to-date list of all shells used in the application, and set for all of them
  8689. the cursor to a watch or to the default cursor, with the 2 functions provided.
  8690.  
  8691. - in Dan Heller's code (later), the idea is to turn on the watch cursor for
  8692. the top-level shell only, popup a working window to possibly abort the
  8693. callback, and manage some expose events during the callback.
  8694.  
  8695. - in the FAQ for comp.windows.x (#113), the idea is to bring a large window on
  8696. top of the application, hide all windows below it, and turn on the watch
  8697. cursor on this large window. Unmapping the large window resets the default
  8698. cursor, mapping it turns on the watch cursor.
  8699.  
  8700. From Baudouin Raoult (mab@ecmwf.co.uk)
  8701.  
  8702. void my_SetWatchCursor(w)
  8703. Widget w;
  8704. {
  8705.         static Cursor watch = NULL;
  8706.  
  8707.         if(!watch)
  8708.                 watch = XCreateFontCursor(XtDisplay(w),XC_watch);
  8709.  
  8710.         XDefineCursor(XtDisplay(w),XtWindow(w),watch);
  8711.         XmUpdateDisplay(w);
  8712. }
  8713.  
  8714. void my_ResetCursor(w)
  8715. Widget w;
  8716. {
  8717.         XUndefineCursor(XtDisplay(w),XtWindow(w));
  8718.         XmUpdateDisplay(w);
  8719. }
  8720.  
  8721.  
  8722. Answer: A solution with lots of bells and whistles is
  8723.  
  8724. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  8725.  * This program is freely distributable without licensing fees and
  8726.  * is provided without guarantee or warrantee expressed or implied.
  8727.  * This program is -not- in the public domain.
  8728.  */
  8729.  
  8730. /* busy.c -- demonstrate how to use a WorkingDialog and to process
  8731.  * only "important" events.  e.g., those that may interrupt the
  8732.  * task or to repaint widgets for exposure.  Set up a simple shell
  8733.  * and a widget that, when pressed, immediately goes into its own
  8734.  * loop.  First, "lock" the shell so that a timeout cursor is set on
  8735.  * the shell and pop up a WorkingDialog.  Then enter loop ... sleep
  8736.  * for one second ten times, checking between each interval to see
  8737.  * if the user clicked the Stop button or if any widgets need to be
  8738.  * refreshed.  Ignore all other events.
  8739.  *
  8740.  * main() and get_busy() are stubs that would be replaced by a real
  8741.  * application; all other functions can be used "as is."
  8742.  */
  8743. #include <Xm/MessageB.h>
  8744. #include <Xm/PushB.h>
  8745. #include <X11/cursorfont.h>
  8746.  
  8747. Widget shell;
  8748. void TimeoutCursors();
  8749. Boolean CheckForInterrupt();
  8750.  
  8751. main(argc, argv)
  8752. int argc;
  8753. char *argv[];
  8754. {
  8755.     XtAppContext app;
  8756.     Widget button;
  8757.     XmString label;
  8758.     void get_busy();
  8759.  
  8760.     shell = XtVaAppInitialize(&app, "Demos",
  8761.         NULL, 0, &argc, argv, NULL, NULL);
  8762.  
  8763.     label = XmStringCreateLocalized(
  8764.         "Boy, is *this* going to take a long time.");
  8765.     button = XtVaCreateManagedWidget("button",
  8766.         xmPushButtonWidgetClass, shell,
  8767.         XmNlabelString,          label,
  8768.         NULL);
  8769.     XmStringFree(label);
  8770.     XtAddCallback(button, XmNactivateCallback, get_busy, argv[1]);
  8771.  
  8772.     XtRealizeWidget(shell);
  8773.     XtAppMainLoop(app);
  8774. }
  8775.  
  8776. void
  8777. get_busy(widget)
  8778. Widget widget;
  8779. {
  8780.     int n;
  8781.  
  8782.     TimeoutCursors(True, True);
  8783.     for (n = 0; n < 10; n++) {
  8784.         sleep(1);
  8785.         if (CheckForInterrupt()) {
  8786.             puts("Interrupt!");
  8787.             break;
  8788.         }
  8789.     }
  8790.     if (n == 10)
  8791.         puts("done.");
  8792.     TimeoutCursors(False, NULL);
  8793. }
  8794.  
  8795. /* The interesting part of the program -- extract and use at will */
  8796. static Boolean stopped;  /* True when user wants to stop processing */
  8797. static Widget dialog;    /* WorkingDialog displayed when timed out */
  8798.  
  8799. /* timeout_cursors() turns on the "watch" cursor over the application
  8800.  * to provide feedback for the user that he's going to be waiting
  8801.  * a while before he can interact with the appliation again.
  8802.  */
  8803. void
  8804. TimeoutCursors(on, interruptable)
  8805. int on, interruptable;
  8806. {
  8807.     static int locked;
  8808.     static Cursor cursor;
  8809.     extern Widget shell;
  8810.     XSetWindowAttributes attrs;
  8811.     Display *dpy = XtDisplay(shell);
  8812.     XEvent event;
  8813.     Arg args[1];
  8814.     XmString str;
  8815.     extern void stop();
  8816.  
  8817.     /* "locked" keeps track if we've already called the function.
  8818.      * This allows recursion and is necessary for most situations.
  8819.      */
  8820.     on? locked++ : locked--;
  8821.     if (locked > 1 || locked == 1 && on == 0)
  8822.         return; /* already locked and we're not unlocking */
  8823.  
  8824.     stopped = False; /* doesn't matter at this point; initialize */
  8825.     if (!cursor) /* make sure the timeout cursor is initialized */
  8826.         cursor = XCreateFontCursor(dpy, XC_watch);
  8827.  
  8828.     /* if "on" is true, then turn on watch cursor, otherwise, return
  8829.      * the shell's cursor to normal.
  8830.      */
  8831.     attrs.cursor = on? cursor : None;
  8832.  
  8833.     /* change the main application shell's cursor to be the timeout
  8834.      * cursor (or to reset it to normal).  If other shells exist in
  8835.      * this application, they will have to be listed here in order
  8836.      * for them to have timeout cursors too.
  8837.      */
  8838.     XChangeWindowAttributes(dpy, XtWindow(shell), CWCursor, &attrs);
  8839.  
  8840.     XFlush(dpy);
  8841.  
  8842.     if (on) {
  8843.         /* we're timing out, put up a WorkingDialog.  If the process
  8844.          * is interruptable, allow a "Stop" button.  Otherwise, remove
  8845.          * all actions so the user can't stop the processing.
  8846.          */
  8847.         str = XmStringCreateLocalized("Busy.  Please Wait.");
  8848.         XtSetArg(args[0], XmNmessageString, str);
  8849.         dialog = XmCreateWorkingDialog(shell, "Busy", args, 1);
  8850.         XmStringFree(str);
  8851.         XtUnmanageChild(
  8852.             XmMessageBoxGetChild(dialog, XmDIALOG_OK_BUTTON));
  8853.         if (interruptable) {
  8854.             str = XmStringCreateLocalized("Stop");
  8855.             XtVaSetValues(dialog, XmNcancelLabelString, str, NULL);
  8856.             XmStringFree(str);
  8857.             XtAddCallback(dialog, XmNcancelCallback, stop, NULL);
  8858.         } else
  8859.             XtUnmanageChild(
  8860.                 XmMessageBoxGetChild(dialog, XmDIALOG_CANCEL_BUTTON));
  8861.         XtUnmanageChild(
  8862.             XmMessageBoxGetChild(dialog, XmDIALOG_HELP_BUTTON));
  8863.         XtManageChild(dialog);
  8864.     } else {
  8865.         /* get rid of all button and keyboard events that occured
  8866.          * during the time out.  The user shouldn't have done anything
  8867.          * during this time, so flush for button and keypress events.
  8868.          * KeyRelease events are not discarded because accelerators
  8869.          * require the corresponding release event before normal input
  8870.          * can continue.
  8871.          */
  8872.         while (XCheckMaskEvent(dpy,
  8873.                 ButtonPressMask | ButtonReleaseMask | ButtonMotionMask
  8874.                 | PointerMotionMask | KeyPressMask, &event)) {
  8875.             /* do nothing */;
  8876.         }
  8877.         XtDestroyWidget(dialog);
  8878.     }
  8879. }
  8880.  
  8881. /* User Pressed the "Stop" button in dialog. */
  8882. void
  8883. stop(dialog)
  8884. Widget dialog;
  8885. {
  8886.     stopped = True;
  8887. }
  8888.  
  8889. Boolean
  8890. CheckForInterrupt()
  8891. {
  8892.     extern Widget shell;
  8893.     Display *dpy = XtDisplay(shell);
  8894.     Window win = XtWindow(dialog);
  8895.     XEvent event;
  8896.  
  8897.     /* Make sure all our requests get to the server */
  8898.     XFlush(dpy);
  8899.  
  8900.     /* Let motif process all pending exposure events for us. */
  8901.     XmUpdateDisplay(shell);
  8902.  
  8903.     /* Check the event loop for events in the dialog ("Stop"?) */
  8904.     while (XCheckMaskEvent(dpy,
  8905.             ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
  8906.             PointerMotionMask | KeyPressMask | KeyReleaseMask,
  8907.             &event)) {
  8908.         /* got an "interesting" event. */
  8909.         if (event.xany.window == win)
  8910.             XtDispatchEvent(&event); /* it's in our dialog.. */
  8911.         else /* uninteresting event--throw it away and sound bell */
  8912.             XBell(dpy, 50);
  8913.     }
  8914.     return stopped;
  8915. }
  8916.  
  8917.  
  8918. -----------------------------------------------------------------------------
  8919. Subject: 216)  Can I use the hourglass that mwm uses?
  8920.  
  8921. [Last modified: March 93]
  8922.  
  8923. Answer: The hourglass used by mwm is hard-coded into code that is subject to
  8924. OSF copyright. In Motif 1.2 though, the bitmaps for this and other things
  8925. (information, no_enter, question, warning, working) were made available.  The
  8926. install process will probably add them to /usr/include/X11/bitmaps.
  8927. Otherwise, just use the watch cursor XC_watch of the previous question,
  8928. because that has the same semantics.
  8929.  
  8930.  
  8931. -----------------------------------------------------------------------------
  8932. Subject: 217)  What order should the libraries be linked in?
  8933.  
  8934. [Last modified: August 92]
  8935.  
  8936. Answer: At link time, use the library order  -lXm -lXt -lX11. There are two
  8937. reasons for this (dbrooks@osf.org):
  8938.  
  8939. On most systems, the order matters because the linker won't re-scan a library
  8940. once it is done with it.  Thus any references to Xlib calls from Xm will
  8941. probably be unresolved.
  8942.  
  8943. The [other] problem is that there are two VendorShell widgets. A dummy is
  8944. provided in the Xt library, but a widget set will rely on its own being
  8945. referenced.  If you mention Xt first, the linker will choose the wrong one.
  8946.  
  8947. Motif code will wrongly assume the Motif VendorShell has been class-
  8948. initialized [and will probably crash].
  8949.  Xaw has a similar problem, but a softer landing; it only complains about
  8950. unregistered converters.
  8951.  
  8952.  
  8953. -----------------------------------------------------------------------------
  8954. Subject: 218)  How do I use xmkmf for Motif clients?
  8955.  
  8956. [Last modified: October 1992]
  8957.  
  8958. Answer: This advice comes from dbrooks@osf.org:
  8959.  
  8960. There are a number of intractable problems with using X configuration files
  8961. and xmkmf, while trying to make it easy to build Motif.  Not the least of
  8962. these, but one I've never heard mentioned yet, is that the rules for
  8963. contructing the names of shared library macros are machine-dependent, and in
  8964. the various xxxLib.tmpl files.  Do we edit all those files to add definitions
  8965. for XMLIB, DEPXMLIB, etc., or do we put a maze of #ifdefs into the Motif.tmpl
  8966. file?
  8967.  
  8968. Please note that, if you install Motif, it overwrites your installed
  8969. Imake.tmpl with one that includes Motif.tmpl and Motif.rules.
  8970.  
  8971. With those caveats, I think the following guidelines will help.
  8972.  
  8973. David Brooks OSF
  8974.  
  8975. Clients in the X11R5 release use the xmkmf command to build Makefiles.  In
  8976. general, the xmkmf command cannot be used for Motif clients, because of the
  8977. need to consider the UseInstalledMotif flag separately.  Since xmkmf is a
  8978. simple script that calls imake, it is easy to construct the proper call to
  8979. imake using the following rules.
  8980.  
  8981. In the following, replace {MTOP} by the toplevel directory with the Motif
  8982. source tree, and {XTOP} by the toplevel ("mit") directory with the X source.
  8983. It is assumed that the directory containing your installed imake is in your
  8984. PATH.
  8985.  
  8986. When needed, the imake variables XTop and MTop are normally set in your
  8987. site.def (to {XTOP} amd {MTOP} respectively); however they may also be set
  8988. with additional -D arguments to imake.
  8989.  
  8990. 1. With both X and Motif in their source trees, ensure the imake variables
  8991.  
  8992.  
  8993.                                     - 10 -
  8994.  
  8995.  
  8996.    XTop and MTop are set, and use:
  8997.  
  8998.         ${XTOP}/config/imake -I{MTOP}/config
  8999.  
  9000. 2. With Motif in its source tree, and X installed, ensure MTop is set, and
  9001.    use:
  9002.  
  9003.         imake -I{MTOP}/config -DUseInstalled
  9004.  
  9005. 3. With both Motif and X installed, and a nonstandard ProjectRoot (see
  9006.    site.def for an explanation of this), use:
  9007.  
  9008.         imake -DUseInstalled -DUseInstalledMotif -I{ProjectRoot}/lib/X11/config
  9009.  
  9010.    or, if the configuration files are in /usr/lib/X11/config:
  9011.  
  9012.         imake -DUseInstalled -DUseInstalledMotif
  9013.  
  9014.  
  9015. To build a simple Imakefile, remember to include lines like this:
  9016.  
  9017.         LOCAL_LIBRARIES = XmClientLibs
  9018.                 DEPLIBS = XmClientDepLibs
  9019.  
  9020. Or, for a client that uses uil/mrm, replace these by MrmClientLibs and
  9021. MrmClientDepLibs, and also use:
  9022.  
  9023.         MSimpleUilTarget(program)
  9024.  
  9025. to build the client and uid file.  Look at the demos for more examples.
  9026.  
  9027.  
  9028. And Paul Howell <grue@engin.umich.edu> added:
  9029.  
  9030. i did this, calling the new script "xmmkmf".  It passes both -DUseInstalled
  9031. and -DUseInstalledMotif.
  9032.  
  9033. and i modified the stock R5 Imake.tmpl to do this:
  9034.  
  9035. #include <Project.tmpl>
  9036. #ifdef UseInstalledMotif
  9037. #include <Motif.tmpl>
  9038. #endif
  9039.  
  9040. #include <Imake.rules>
  9041. #ifdef UseInstalledMotif
  9042. #include <Motif.rules>
  9043. #endif
  9044.  
  9045. the result was something that does both athena and motif rules.  and it really
  9046. works, just that easy!
  9047.  
  9048.  
  9049. -----------------------------------------------------------------------------
  9050. Subject: 219)  How do I make context sensitive help?  The Motif Style Guide
  9051. says that an application must initiate context-sensitive help by changing the
  9052. shape of the pointer to the question pointer. When the user moves the pointer
  9053. to the component help is wanted on and presses BSelect, any available context
  9054. sensitive help for the component must be presented, and the pointer reverts
  9055. from the question pointer.
  9056. [Last modified: August 92]
  9057.  
  9058. Answer: A widget that gives context sensitive help would place this help in
  9059. the XmNhelpCallback function. To trigger this function: (from Martin G C
  9060. Davies, mgcd@se.alcbel.be)
  9061.  
  9062. I use the following callback that is called when the "On Context" help
  9063. pulldown menu is selected. It does the arrow bit and calls the help callbacks
  9064. for the widget. It also zips up the widget tree looking for help if needs be.
  9065. I don't restrict the arrows motion so I can get help on dialog boxes. No
  9066. prizes for guessing what "popup_message" does.
  9067.  
  9068.  
  9069. static void ContextHelp(
  9070.     Widget              w ,
  9071.     Opaque              * tag ,
  9072.     XmAnyCallbackStruct * callback_struct
  9073. )
  9074. {
  9075.     static Cursor   context_cursor = NULL ;
  9076.     Widget          context_widget ;
  9077.  
  9078.     if ( context_cursor == NULL )
  9079.         context_cursor = XCreateFontCursor( display, XC_question_arrow ) ;
  9080.  
  9081.     context_widget = XmTrackingLocate( top_level_widget,
  9082.                                 context_cursor, FALSE ) ;
  9083.  
  9084.     if ( context_widget != NULL ) /* otherwise its not a widget */
  9085.     {
  9086.         XmAnyCallbackStruct cb ;
  9087.  
  9088.         cb.reason = XmCR_HELP ;
  9089.         cb.event = callback_struct->event ;
  9090.  
  9091.         /*
  9092.          * If there's no help at this widget we'll track back
  9093.            up the hierarchy trying to find some.
  9094.          */
  9095.  
  9096.         do
  9097.         {
  9098.             if ( ( XtHasCallbacks( context_widget, XmNhelpCallback ) ==
  9099.                                                 XtCallbackHasSome ) )
  9100.             {
  9101.                 XtCallCallbacks( context_widget, XmNhelpCallback, & cb ) ;
  9102.                 return ;
  9103.             }
  9104.             else
  9105.                 context_widget = XtParent( context_widget ) ;
  9106.         } while ( context_widget != NULL ) ;
  9107.     }
  9108.  
  9109.     popup_message( "No context-sensitive help found\n\
  9110. for the selected object." ) ;
  9111. }
  9112.  
  9113.  
  9114. Dave Bonnett suggested, to use the following translations for XmText (and
  9115. XmTextField) widgets to get the same help with key strokes, and to provide an
  9116. accelerator label in the Context help menu entry.
  9117.  
  9118. MyApp*XmText*translations: #override\n\
  9119.                                 <Key>F1:    Help()
  9120.  
  9121. MyApp*Help_menu*Contextual Help.acceleratorText:   F1
  9122.  
  9123. MyApp*defaultVirtualBindings:           osfBackSpace : <Key>Delete\n\
  9124.                                         osfRight : <Key>Right\n\
  9125.                                         osfLeft  : <Key>Left\n\
  9126.                                         osfUp    : <Key>Up\n\
  9127.                                         osfHelp  : <Key>F1\n\
  9128.                                         osfDown  : <Key>Down
  9129.  
  9130.  
  9131. -----------------------------------------------------------------------------
  9132. Subject: 220)  How do I debug a modal interaction?
  9133.  
  9134. When an application crashes in a modal section (such as in a modal dialog, a
  9135. menu or when a drag and drop is in action), I cannot access the debugger.
  9136.  
  9137. [Last modified: January 1993]
  9138.  
  9139. Answer: Run the debugger on one display while the application writes to
  9140. another display.
  9141.  
  9142. -----------------------------------------------------------------------------
  9143. Subject: 221)  How can I disable Drag and Drop in my Motif 1.2 client ?
  9144.  
  9145. [Last modified: Oct 94]
  9146.  
  9147. Answer: Several people have reported that for complex hierarchies of widgets,
  9148. drag and drop can slow down an application considerably. If you do not need
  9149. drag and drop's significant power, you can disable it in your application.
  9150.  
  9151. Set the XmDisplay drag-protocol resources to XmDRAG_NONE.  The following code
  9152. fragment demonstrates this:
  9153.  
  9154. #include <Xm/Display.h>
  9155.  
  9156.  
  9157.     dw = XmGetXmDisplay(XtDisplay(shell));
  9158.     /* where "shell" is your client's top-level shell. */
  9159.  
  9160.     XtVaSetValues(dw, XmNdragInitiatorProtocolStyle, XmDRAG_NONE, NULL);
  9161.     XtVaSetValues(dw, XmNdragReceiverProtocolStyle,  XmDRAG_NONE, NULL);
  9162.  
  9163.  
  9164. thanks to Lance Purple (purple@austin.ibm.com)
  9165.  
  9166. Ken Lee (kenton@esd.sgi.com) and Christoph Widmer
  9167. (widmer@einsteinium.SLCS.SLB.COM) describe how to disable drag and drop from a
  9168. resource file:
  9169.  
  9170.         *dragInitiatorProtocolStyle: XmDRAG_NONE
  9171.         *dragReceiverProtocolStyle:  XmDRAG_NONE
  9172.  
  9173. Ken Lee also notes that as of Motif 1.2, the "Xm" prefix is required for all
  9174. token constants in resource files. (Which is why specifying "DRAG_NONE" won't
  9175. work but "XmDRAG_NONE" will.)
  9176.  
  9177. -----------------------------------------------------------------------------
  9178. Subject: 222)  Where can I get info on the Motif drag and drop protocol?
  9179.  
  9180. [Last modified: Sept 94]
  9181.  
  9182. Answer: The drag and drop protocol implemented by OSF is not stable, so they
  9183. have not published it yet. The API should remain stable though.  The OSF
  9184. protocol is not compatable with the OpenLook protocol.  OSF and Sun are
  9185. working on a joint protocol for publication.
  9186.  
  9187. For programming examples on Motif drag and drop, see the Motif 1.2 Programmers
  9188. Guide.
  9189.  
  9190. For a third alternative, try Roger Reynolds drag and drop protocol, available
  9191. from netcom.com in /pub/rogerr.
  9192.  
  9193. Ken Lee, kenton@esd.sgi.com writes: OSF's "Motif Programmers Guide" includes
  9194. complete source code for several drag and drop demos.  There are some simple
  9195. programs demonstrating the basic behaviour, as well as complex programs
  9196. demonstrating more sophisticated options.  I think the source code for some of
  9197. the demos also appears on the OSF tape.
  9198.  
  9199.  
  9200. -----------------------------------------------------------------------------
  9201. Subject: 223)  Why can't I install my own colormap using XInstallColormap?
  9202.  
  9203. [Last modified: Sept 94]
  9204.  
  9205. Answer: You shouldn't install the colormap yourself using XInstallColormap.
  9206. See the ICCCM document for all the reasons.  Instead put the colormap as an
  9207. argument on the Shell widget and the window manager will take care of this.
  9208.  
  9209. When the colormap is installed,  unless you have a display with multiple
  9210. colormaps, the other windows will go "technicolor" and there is no way around
  9211. this problem.
  9212.  
  9213. Thanks to Doug Rand <drand@osf.org>
  9214.  
  9215. -----------------------------------------------------------------------------
  9216. Subject: 224)  How do I get correct shadow colors to match other color
  9217. changes?
  9218.  
  9219. [Last modified: Sept 94]
  9220.  
  9221. Answer:
  9222.  
  9223. Thanks to Craig MacFarlane (craigm@chateau-rouge.ICS.UCI.EDU) for the
  9224. following explanation and code:
  9225.  
  9226. You have to make a call to calculate the new shadow colors.  The trick is
  9227. actually getting a value of type Pixel when all you have is the string "Blue".
  9228. I use the XtConvertAndStore() function to convert from a char * to a Pixel.
  9229. For example:
  9230.  
  9231.  
  9232.   char *color = "blue";
  9233.   XrmValue color_value, pixel_value;
  9234.   Pixel background;
  9235.  
  9236.   color_value.size = strlen(color);
  9237.   color_value.addr = (XtPointer) color;
  9238.   pixel_value.size = sizeof(Pixel);
  9239.   pixel_value.addr = (XtPointer) 0;
  9240.  
  9241.   result = XtConvertAndStore(widget,
  9242.                              XtRString, &color_value,
  9243.                              XtRPixel, &pixel_value);
  9244.  
  9245.   background = (*(Pixel *)pixel_value.addr);
  9246.  
  9247.  
  9248. You can then use the pixel value obtained by XtConvertAndStore() in the
  9249. XmGetColors call.  XmGetColors calculates appropriate foreground, topshadow,
  9250. bottomshadow, and select colors for the given background. e.g.
  9251.  
  9252.  
  9253.   XmGetColors(screen,
  9254.               DefaultColormap(display_id, DefaultScreen(display_id)),
  9255.               background,
  9256.               &foreground, &topshadow, &bottomshadow, &select);
  9257.  
  9258.  
  9259. From here it's trivial to set the shadow colors at the same time you set the
  9260. foreground and background colors.  For example:
  9261.  
  9262.  
  9263.   XtVaSetValues(widget,
  9264.                 XmNforeground, foreground,
  9265.                 XmNbackground, background,
  9266.                 XmNarmColor, select,
  9267.                 XmNtopShadowColor, topshadow,
  9268.                 XmNbottomShadowColor, bottomshadow,
  9269.                 NULL);
  9270.  
  9271.  
  9272. You'll get asthetically pleasing colors every time. :)
  9273.  
  9274. -----------------------------------------------------------------------------
  9275. Subject: 225)  What color algorithm does Motif use?  I am told that Motif uses
  9276. some sort of algorithm that will take a single color that is defined for the
  9277. "background" and scale it so that the widget remains discriminable from the
  9278. background, etc.  What is the algorithm?
  9279.  
  9280. [Last modified: Oct 94]
  9281.  
  9282. Answer: Chris Flatters (cflatter@nrao.edu) writes: Shiz Kobara's book "Visual
  9283. Design with OSF/Motif", Addison Wesley,  1991, ISBN 0-201-56320-7) is a good
  9284. source for information of this sort.  I haven't seen it in bookshops for a
  9285. while so it may have gone out of print (which would be a pity).  In essence
  9286. each widget has 4 colours which, to first order, are
  9287.  
  9288.         background
  9289.         select          (background * 85%)
  9290.         top shadow      (background * 150%)
  9291.         bottom shadow   (background * 50%)
  9292.  
  9293. An additional correction may be applied to the hues of the calculated colours
  9294. if any of the RGB values saturates.  The algorithm works best if the brightest
  9295. of the RGB components lies in the range 155-175 (on a scale of 0-255).  The
  9296. top shadow becomes darker than the background for light background colours
  9297. which does not lead to a particularly pleasing effect.
  9298.  
  9299. -----------------------------------------------------------------------------
  9300. Subject: 226)  How can you access the superclass widget from which Motif
  9301. convenience dialogs are subclassed?
  9302.  
  9303. [Last modified: Oct 94]
  9304.  
  9305. Answer: From Kim Frei (uunet!ask.uniras.dk!kimf): If you are using Motif 1.2,
  9306. read about XmTemplateDialog.
  9307.  
  9308. -----------------------------------------------------------------------------
  9309. Subject: 227)  Can the Notebook widget display non-rectangular "file tabs"?
  9310. Is it possible to use the Shape extension to fiddle with the shape of the
  9311. major tabs (XmPushButtons right now) to get non-rectangular buttons, going for
  9312. that "file tab" look?
  9313.  
  9314. [Last modified: Dec 94]
  9315.  
  9316. Answer: Vania Joloboff <uunet!gr.osf.org!vania> wrote:
  9317.  
  9318. On the Motif [1.2] cdrom, in the demos directory, there is a library of
  9319. additional widgets lib/Exm.  Among the widgets, there is a ExmTabButton
  9320. especially designed to fit within a Notebook. It has a smooth shape like real
  9321. tabs in folders.
  9322.  
  9323. It also a good example on how to use the new traits and the Xme API for widget
  9324. writers.
  9325.  
  9326. -----------------------------------------------------------------------------
  9327. Subject: 228)  How does the clipboard mechanism work?
  9328.  
  9329. [Last modified: Dec 94]
  9330.  
  9331. A.  Doug Rand <drand@x.org> writes:
  9332.  
  9333. Basically there are two selections CLIPBOARD_MANAGER and CLIPBOARD which are
  9334. used.  The Motif clipboard is not a clipboard manager, but xclipboard,  or a
  9335. more functional clipboard client would be.  The newest ICCCM (2.0) spells this
  9336. out.
  9337.  
  9338. The basic process is that the clipboard manager:
  9339.  
  9340. 1) Check to see if CLIPBOARD_MANAGER is owned by anyone,  abort if it is.
  9341.  
  9342. 2) Assert ownership of CLIPBOARD_MANAGER and CLIPBOARD
  9343.  
  9344. 3) When the CLIPBOARD selection is lost,  query new owner for data and then
  9345. retake ownership of CLIPBOARD
  9346.  
  9347. #3 is done until the application exists.  What you do with the data is up to
  9348. the application.
  9349.  
  9350. -----------------------------------------------------------------------------
  9351. Subject: 229)+ Why does the xyz application core dump when I cut and paste?
  9352.  
  9353. Answer: Application crashes when text is cut and pasted into an XmText widget
  9354. may occur with statically linked executables linked with X11R5 libraries under
  9355. SunOS. For example, a Netscape README file says:
  9356.  
  9357.     The SunOS 4.1 [Netscape 0.94] distribution also includes a directory
  9358.     called "nls".  This directory is a standard part of the MIT X11R5
  9359.     distribution, but is not included with OpenWindows 3.0 or earlier.  We
  9360.     have linked Netscape against the MIT R5 libraries because they are
  9361.     less buggy in general; however, they have one rather serious bug,
  9362.     which is that if this "nls" directory does not exist, the program will
  9363.     dump core any time you try to paste into a text field!
  9364.  
  9365.     So, if you don't have the "nls" directory on your system, you will
  9366.     need to install it first.  The usual place is /usr/lib/X11/nls,
  9367.     but you can put it anywhere: just point the $XNLSPATH environment
  9368.     variable at it.
  9369.  
  9370.     Some sites don't have their X libraries installed in /usr/lib/X11/.
  9371.     This doesn't matter.  You either need to put the nls directory in
  9372.     /usr/lib/X11/, or every user will need to set this environment
  9373.     variable.
  9374.  
  9375. So, for example, we do:
  9376.  
  9377.        setenv XNLSPATH /usr/local/x11r5/lib/X11/nls
  9378.  
  9379. since our X11R5 is not installed in the default location.
  9380.  
  9381. -----------------------------------------------------------------------------
  9382. Subject: 230)  TOPIC: HISTORY and ACKNOWLEDGEMENTS
  9383.  
  9384. Answer:
  9385.  
  9386. History:
  9387. -------
  9388. November 89 to July 93: FAQ was maintained by Jan Newmarch
  9389.                         (jan@ise.canberra.edu.au)
  9390.  
  9391. July 93 to August 94:   FAQ was maintained by Brian Dealy
  9392.                         (dealy@c3i.saic.com)
  9393.  
  9394. Acknowledgments:
  9395. ----------------
  9396. This list was compiled using questions and answers posed to
  9397. comp.windows.x.motif and motif-talk. Some information was excerpted from the
  9398. comp.windows.x FAQ.  To all who contributed one way or the other, thanks! We
  9399. haven't often given individual references, but you may recognize
  9400. contributions. If weve mangled them too much, let the current maintainer know.
  9401.  
  9402.  
  9403.   Jan Newmarch, Information Science and Engineering,
  9404.   University of Canberra, PO Box 1, Belconnen, Act 2616
  9405.   Australia. Tel: (Aust) 6-2522422. Fax: (Aust) 6-2522999
  9406.  
  9407.   ACSnet: jan@ise.canberra.edu.au
  9408.   ARPA:   jan%ise.canberra.edu.au@uunet.uu.net
  9409.   UUCP:   {uunet,ukc}!munnari!ise.canberra.edu.au!jan
  9410.   JANET:  jan%au.edu.canberra.ise@EAN-RELAY
  9411.  
  9412.  
  9413. Jan Newmarch maintained this FAQ for a long time and has really helped a great
  9414. many of us by providing this valuable service.  He deserves a big round of
  9415. applause for his efforts.  I use this resource all the time and it has saved
  9416. me countless hours with manuals and source code trying to relearn what others
  9417. have already discovered.  Jan`s efforts are gratefully acknowledged here.
  9418.  
  9419.  
  9420.   Brian Dealy, SAIC
  9421.   dealy@c3i.saic.com
  9422.  
  9423.  
  9424. Likewise, Brian Dealy of SAIC did an admirable job taking over the Motif FAQ
  9425. from Jan. A considerable amount of information was added during his tenure and
  9426. we greatly appreciate Brian's work on the FAQ, as well as his efforts in
  9427. maintaining the comp.windows.x.motif newsgroup reflector, for the good of all
  9428. Motif-dom.
  9429.  
  9430.  
  9431.   Ken Sall, Century Computing, Inc.
  9432.   ksall@cen.com
  9433.  
  9434.  
  9435.